pub struct GenerateImageRequest {Show 13 fields
pub prompt: String,
pub model: Option<String>,
pub negative_prompt: Option<String>,
pub width: Option<u32>,
pub height: Option<u32>,
pub steps: Option<u32>,
pub guidance: Option<f32>,
pub seed: Option<u64>,
pub output_path: Option<String>,
pub format: String,
pub input_image_path: Option<String>,
pub variant_count: Option<u32>,
pub parent_image_path: Option<String>,
}Expand description
Request to generate an image from text.
Default is implemented manually (not derived) because format
has a sensible non-empty default ("png") that
String::default() would clobber to "". Callers can
GenerateImageRequest { prompt: "...".into(), ..Default::default() }
and get a usable shape. Mirrors the GenerateRequest ergonomic
fix from #109.
Fields§
§prompt: String§model: Option<String>§negative_prompt: Option<String>§width: Option<u32>§height: Option<u32>§steps: Option<u32>§guidance: Option<f32>§seed: Option<u64>§output_path: Option<String>§format: String§input_image_path: Option<String>Input image to transform (img2img). Backends that don’t
support image conditioning return an
InferenceError::UnsupportedMode if this is set.
variant_count: Option<u32>Number of variants to generate in one call. None (or 1)
produces a single image — matches the original
generate_image contract. Backends that don’t support
batching either loop internally or error if > 1. Honoured
by crate::InferenceEngine::generate_image_batch; the
scalar crate::InferenceEngine::generate_image forces it
to 1.
parent_image_path: Option<String>Anchor for cross-call continuity — instructs the model to
generate variants in the visual neighbourhood of this image.
Currently meaningful only on backends that natively support
the concept (e.g. gpt-image-2). Other backends ignore the
hint or return UnsupportedMode.
Trait Implementations§
Source§impl Clone for GenerateImageRequest
impl Clone for GenerateImageRequest
Source§fn clone(&self) -> GenerateImageRequest
fn clone(&self) -> GenerateImageRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenerateImageRequest
impl Debug for GenerateImageRequest
Source§impl Default for GenerateImageRequest
impl Default for GenerateImageRequest
Source§impl<'de> Deserialize<'de> for GenerateImageRequest
impl<'de> Deserialize<'de> for GenerateImageRequest
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>,
Auto Trait Implementations§
impl Freeze for GenerateImageRequest
impl RefUnwindSafe for GenerateImageRequest
impl Send for GenerateImageRequest
impl Sync for GenerateImageRequest
impl Unpin for GenerateImageRequest
impl UnsafeUnpin for GenerateImageRequest
impl UnwindSafe for GenerateImageRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more