-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
Conversation
files.push(filesIterator.next()); | ||
const file = filesIterator.next(); | ||
console.log( | ||
`Reading file: ${file.getName()} with mime type: ${file.getMimeType()}` |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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@')) { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
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.
Fixes a bug where larger sized images and jpeg images were not generated. Also adds support for Imagen 3 on the scaled version.