pub struct ImageGenRequest {
pub prompt: String,
pub width: u32,
pub height: u32,
pub model: Option<String>,
pub style: Option<ImageStyle>,
pub negative_prompt: Option<String>,
pub seed: Option<u64>,
}Expand description
A request to generate an image — the battle orders for visual creation.
Fields§
§prompt: StringThe prompt describing the desired image.
width: u32Width in pixels (default: 1024).
height: u32Height in pixels (default: 1024).
model: Option<String>Specific model to use for generation.
style: Option<ImageStyle>Visual style preset.
negative_prompt: Option<String>Negative prompt — what to avoid in the image.
seed: Option<u64>Seed for reproducible generation.
Implementations§
Source§impl ImageGenRequest
impl ImageGenRequest
Sourcepub fn new(prompt: impl Into<String>) -> Self
pub fn new(prompt: impl Into<String>) -> Self
Create a new image generation request with default dimensions.
Sourcepub fn with_dimensions(self, width: u32, height: u32) -> Self
pub fn with_dimensions(self, width: u32, height: u32) -> Self
Set the image dimensions.
Sourcepub fn with_style(self, style: ImageStyle) -> Self
pub fn with_style(self, style: ImageStyle) -> Self
Set the style preset.
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the model to use.
Sourcepub fn with_negative_prompt(self, negative_prompt: impl Into<String>) -> Self
pub fn with_negative_prompt(self, negative_prompt: impl Into<String>) -> Self
Set the negative prompt.
Trait Implementations§
Source§impl Clone for ImageGenRequest
impl Clone for ImageGenRequest
Source§fn clone(&self) -> ImageGenRequest
fn clone(&self) -> ImageGenRequest
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 ImageGenRequest
impl Debug for ImageGenRequest
Source§impl<'de> Deserialize<'de> for ImageGenRequest
impl<'de> Deserialize<'de> for ImageGenRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ImageGenRequest
impl RefUnwindSafe for ImageGenRequest
impl Send for ImageGenRequest
impl Sync for ImageGenRequest
impl Unpin for ImageGenRequest
impl UnsafeUnpin for ImageGenRequest
impl UnwindSafe for ImageGenRequest
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