Download codex-rs/codex-api/src/images.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.98 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/codex-api/src/images.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/codex-api/src/images.rs
-
curl -L -o images.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/codex-api/src/images.rs
1.98 kB
| use serde::Deserialize; | |
| use serde::Serialize; | |
| pub struct ImageGenerationRequest { | |
| pub prompt: String, | |
| pub background: Option<ImageBackground>, | |
| pub model: String, | |
| pub n: Option<u64>, | |
| pub quality: Option<ImageQuality>, | |
| pub size: Option<String>, | |
| } | |
| pub struct ImageEditRequest { | |
| pub images: Vec<ImageUrl>, | |
| pub prompt: String, | |
| pub background: Option<ImageBackground>, | |
| pub model: String, | |
| pub n: Option<u64>, | |
| pub quality: Option<ImageQuality>, | |
| pub size: Option<String>, | |
| } | |
| pub struct ImageUrl { | |
| pub image_url: String, | |
| } | |
| pub enum ImageBackground { | |
| Transparent, | |
| Opaque, | |
| Auto, | |
| } | |
| pub enum ImageQuality { | |
| Low, | |
| Medium, | |
| High, | |
| Auto, | |
| } | |
| pub struct ImageResponse { | |
| pub created: u64, | |
| pub data: Vec<ImageData>, | |
| pub background: Option<ImageBackground>, | |
| pub quality: Option<ImageQuality>, | |
| pub size: Option<String>, | |
| } | |
| pub struct ImageData { | |
| pub b64_json: String, | |
| pub generation_id: Option<String>, | |
| } | |