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

Bug fixes and Imagen 3 support for scaled version #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eqadir
Copy link
Collaborator

@eqadir eqadir commented Feb 19, 2025

Fixes a bug where larger sized images and jpeg images were not generated. Also adds support for Imagen 3 on the scaled version.

files.push(filesIterator.next());
const file = filesIterator.next();
console.log(
`Reading file: ${file.getName()} with mime type: ${file.getMimeType()}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we remove the logging message?

@@ -184,16 +195,49 @@ export class AppComponent implements OnInit {
});
}

createVertexAiCall(current: ImageQueue) {
// TODO(): Update it for imagen 3.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove TODO?

}

getImagenRequestBody(prompt: string, imageBase64: string) {
if (this.modelId.startsWith('imagegeneration@')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Ideally I guess we could have constants for the model, since it's also shown on the UI.

referenceId: 2,
maskImageConfig: {
maskMode: 'MASK_MODE_BACKGROUND',
dilation: 0.0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we could support this as a parameter in the UI in the future

negativePrompt: '',
promptLanguage: 'en',
editConfig: {
baseSteps: 75,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also this?

});
} else if (modelId.startsWith('imagen-3.0')) {
if (backgroundRemoval) {
return createRequestOptions({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps in the future we could refactor this and the above duplicated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants