Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TextToImage OCP API #40326

Merged
merged 66 commits into from
Oct 26, 2023
Merged

Implement TextToImage OCP API #40326

merged 66 commits into from
Oct 26, 2023

Conversation

marcelklehr
Copy link
Member

@marcelklehr marcelklehr commented Sep 7, 2023

Summary

Implements an OCP API for registering and consuming text to image providers like stable diffusion.

Todo

  • cleanup images in appdata

Checklist

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Psalm found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

lib/private/TextToImage/Manager.php Fixed Show fixed Hide fixed
lib/private/TextToImage/Manager.php Fixed Show fixed Hide fixed
lib/private/TextToImage/Manager.php Fixed Show fixed Hide fixed
core/Controller/TextToImageApiController.php Fixed Show fixed Hide fixed
@juliusknorr juliusknorr self-requested a review October 9, 2023 12:30
@marcelklehr marcelklehr marked this pull request as ready for review October 10, 2023 08:12
@sorbaugh sorbaugh requested review from artonge and come-nc October 11, 2023 10:13
core/Controller/TextToImageApiController.php Outdated Show resolved Hide resolved
core/Controller/TextToImageApiController.php Outdated Show resolved Hide resolved
core/Migrations/Version28000Date20230906104802.php Outdated Show resolved Hide resolved
core/Migrations/Version28000Date20230906104802.php Outdated Show resolved Hide resolved
lib/public/TextToImage/IManager.php Outdated Show resolved Hide resolved
lib/private/TextToImage/Manager.php Outdated Show resolved Hide resolved
lib/public/TextToImage/Exception/Exception.php Outdated Show resolved Hide resolved
lib/public/TextToImage/Events/TaskSuccessfulEvent.php Outdated Show resolved Hide resolved
lib/private/TextToImage/TaskBackgroundJob.php Outdated Show resolved Hide resolved
lib/private/TextToImage/Manager.php Show resolved Hide resolved
@marcelklehr marcelklehr force-pushed the enh/text-to-image-api branch from 7f96cc0 to 3e7fd5e Compare October 16, 2023 14:23
lib/private/TextToImage/Manager.php Fixed Show fixed Hide fixed
lib/public/DB/Exception.php Fixed Show fixed Hide fixed
lib/public/DB/Exception.php Fixed Show fixed Hide fixed
core/Controller/TextToImageApiController.php Outdated Show resolved Hide resolved
core/Controller/TextToImageApiController.php Outdated Show resolved Hide resolved
core/Controller/TextToImageApiController.php Outdated Show resolved Hide resolved
core/Migrations/Version28000Date20230906104802.php Outdated Show resolved Hide resolved
lib/private/TextToImage/Db/Task.php Outdated Show resolved Hide resolved
lib/private/TextToImage/Db/TaskMapper.php Fixed Show resolved Hide resolved
$providers = [$provider];
}
} catch (\JsonException $e) {
$this->logger->warning('Failed to decode Text2Image setting `ai.text2image_provider`', ['exception' => $e]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return? Or can we proceed without valid settings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will use the first registered provider if the setting is not set or can't be read. We can change it to error out if the setting isn't valid, but I don't see a good reason.

marcelklehr and others added 12 commits October 18, 2023 13:21
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
…ast_updated to DATETIME

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
core/Controller/TextToImageApiController.php Outdated Show resolved Hide resolved
lib/private/TextToImage/Manager.php Outdated Show resolved Hide resolved
lib/public/AppFramework/Bootstrap/IRegistrationContext.php Outdated Show resolved Hide resolved
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
…imeException

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr requested a review from come-nc October 26, 2023 09:33
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr
Copy link
Member Author

/compile

@marcelklehr
Copy link
Member Author

🎉

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr
Copy link
Member Author

Failures seem unrelated, please merge 🙏

@nickvergessen nickvergessen merged commit 2b7f78f into master Oct 26, 2023
38 of 40 checks passed
@nickvergessen nickvergessen deleted the enh/text-to-image-api branch October 26, 2023 13:53
@ChristophWurst ChristophWurst added the pending documentation This pull request needs an associated documentation update label Oct 27, 2023
@ChristophWurst
Copy link
Member

the new public API needs docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending documentation This pull request needs an associated documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants