-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Vertex AI] Add ImagenGenerationConfig
to generateImages()
#14234
Conversation
Generated by 🚫 Danger |
public var numberOfImages: Int? | ||
public var negativePrompt: String? | ||
public var aspectRatio: ImagenAspectRatio? | ||
public var imageFormat: ImagenImageFormat? | ||
public var addWatermark: Bool? |
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.
Note: Still considering whether these should be mutable. It does make it significantly easier to adjust individual parameters and the config can be assigned to a let
if the developer wants to keep them immutable.
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.
Just thinking aloud here... I've been thinking about what configuration types like this should look like in Swift 6. Here is my current thinking on the options:
- mark unchecked sendable and make each property atomic with a corresponding NSLock that guards a backing ivar (sync)
- Make the Config structure an actor (async)
- Mark the Config structure with a global actor (e.g. VertexAIActor) (async)
- Make a ConfigBuilder class that's an actor (or executes on global actor) that can build a immutable
ImageGenerationConfig
(async for the builder, sync for the produced value)
@ncooke3 Looks like this PR incorrectly triggered Firestore CI? |
@paulb777, I believe it's because the base branch, vertex-imagen, is not in-sync with |
I'll merge |
ImagenGenerationConfig
type for configuring image generation details (number of images, aspect ratio, image format, etc.) that is accepted ingenerateImages()
calls.ImagenAspectRatio
andImagenImageFormat
types to limit the values to those accepted by the model. Updated the#14221
#no-changelog