#[non_exhaustive]pub struct ImageConfig {
pub image_output_options: Option<ImageOutputOptions>,
pub aspect_ratio: Option<String>,
pub person_generation: Option<PersonGeneration>,
pub image_size: Option<String>,
/* private fields */
}Available on crate features
gen-ai-tuning-service or llm-utility-service or prediction-service only.Expand description
Config for image generation features.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.image_output_options: Option<ImageOutputOptions>Optional. The image output format for generated images.
aspect_ratio: Option<String>Optional. The desired aspect ratio for the generated images. The following aspect ratios are supported:
“1:1” “2:3”, “3:2” “3:4”, “4:3” “4:5”, “5:4” “9:16”, “16:9” “21:9”
person_generation: Option<PersonGeneration>Optional. Controls whether the model can generate people.
image_size: Option<String>Optional. Specifies the size of generated images. Supported values are
1K, 2K, 4K. If not specified, the model will use default value 1K.
Implementations§
Source§impl ImageConfig
impl ImageConfig
pub fn new() -> Self
Sourcepub fn set_image_output_options<T>(self, v: T) -> Selfwhere
T: Into<ImageOutputOptions>,
pub fn set_image_output_options<T>(self, v: T) -> Selfwhere
T: Into<ImageOutputOptions>,
Sets the value of image_output_options.
§Example
ⓘ
use google_cloud_aiplatform_v1::model::image_config::ImageOutputOptions;
let x = ImageConfig::new().set_image_output_options(ImageOutputOptions::default()/* use setters */);Sourcepub fn set_or_clear_image_output_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImageOutputOptions>,
pub fn set_or_clear_image_output_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImageOutputOptions>,
Sets or clears the value of image_output_options.
§Example
ⓘ
use google_cloud_aiplatform_v1::model::image_config::ImageOutputOptions;
let x = ImageConfig::new().set_or_clear_image_output_options(Some(ImageOutputOptions::default()/* use setters */));
let x = ImageConfig::new().set_or_clear_image_output_options(None::<ImageOutputOptions>);Sourcepub fn set_aspect_ratio<T>(self, v: T) -> Self
pub fn set_aspect_ratio<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_aspect_ratio<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_aspect_ratio<T>(self, v: Option<T>) -> Self
Sets or clears the value of aspect_ratio.
§Example
ⓘ
let x = ImageConfig::new().set_or_clear_aspect_ratio(Some("example"));
let x = ImageConfig::new().set_or_clear_aspect_ratio(None::<String>);Sourcepub fn set_person_generation<T>(self, v: T) -> Selfwhere
T: Into<PersonGeneration>,
pub fn set_person_generation<T>(self, v: T) -> Selfwhere
T: Into<PersonGeneration>,
Sets the value of person_generation.
§Example
ⓘ
use google_cloud_aiplatform_v1::model::image_config::PersonGeneration;
let x0 = ImageConfig::new().set_person_generation(PersonGeneration::AllowAll);
let x1 = ImageConfig::new().set_person_generation(PersonGeneration::AllowAdult);
let x2 = ImageConfig::new().set_person_generation(PersonGeneration::AllowNone);Sourcepub fn set_or_clear_person_generation<T>(self, v: Option<T>) -> Selfwhere
T: Into<PersonGeneration>,
pub fn set_or_clear_person_generation<T>(self, v: Option<T>) -> Selfwhere
T: Into<PersonGeneration>,
Sets or clears the value of person_generation.
§Example
ⓘ
use google_cloud_aiplatform_v1::model::image_config::PersonGeneration;
let x0 = ImageConfig::new().set_or_clear_person_generation(Some(PersonGeneration::AllowAll));
let x1 = ImageConfig::new().set_or_clear_person_generation(Some(PersonGeneration::AllowAdult));
let x2 = ImageConfig::new().set_or_clear_person_generation(Some(PersonGeneration::AllowNone));
let x_none = ImageConfig::new().set_or_clear_person_generation(None::<PersonGeneration>);Sourcepub fn set_image_size<T>(self, v: T) -> Self
pub fn set_image_size<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_image_size<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_image_size<T>(self, v: Option<T>) -> Self
Sets or clears the value of image_size.
§Example
ⓘ
let x = ImageConfig::new().set_or_clear_image_size(Some("example"));
let x = ImageConfig::new().set_or_clear_image_size(None::<String>);Trait Implementations§
Source§impl Clone for ImageConfig
impl Clone for ImageConfig
Source§fn clone(&self) -> ImageConfig
fn clone(&self) -> ImageConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageConfig
impl Debug for ImageConfig
Source§impl Default for ImageConfig
impl Default for ImageConfig
Source§fn default() -> ImageConfig
fn default() -> ImageConfig
Returns the “default value” for a type. Read more
Source§impl Message for ImageConfig
impl Message for ImageConfig
Source§impl PartialEq for ImageConfig
impl PartialEq for ImageConfig
impl StructuralPartialEq for ImageConfig
Auto Trait Implementations§
impl Freeze for ImageConfig
impl RefUnwindSafe for ImageConfig
impl Send for ImageConfig
impl Sync for ImageConfig
impl Unpin for ImageConfig
impl UnsafeUnpin for ImageConfig
impl UnwindSafe for ImageConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more