Skip to main content

Crate gptimage_2_5_client

Crate gptimage_2_5_client 

Source
Expand description

Lightweight helpers for GPT Image 2.5-style AI image generation workflows.

This crate provides request, aspect-ratio, resolution, and reference-image types for Rust applications that need to organize image generation prompts before handing them to a backend or HTTP client.

use gptimage_2_5_client::{AspectRatio, ImageRequest, Resolution};

let request = ImageRequest::new("A product poster with the headline SPRING SALE")
    .aspect_ratio(AspectRatio::Widescreen)
    .resolution(Resolution::TwoK);

assert_eq!(request.resolution, Resolution::TwoK);
assert!(request.validate().is_ok());

Structs§

ImageRequest
A structured request for an AI image generation workflow.
ReferenceImage
A single reference image supplied to an image-to-image edit.

Enums§

AspectRatio
Common image aspect ratios.
ReferenceRole
How a reference image should steer the generation.
RequestError
Errors produced when a request is not valid.
Resolution
Output resolution tiers.

Constants§

MAX_PROMPT_CHARS
Maximum prompt length in characters.
MAX_REFERENCE_IMAGES
Maximum number of reference images accepted by an image-to-image edit.