mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
Add optional animated GIF output to image generation (#59073)
## What changed
- Gate GIF output behind `features.image_generation_animation`, disabled by default.
- Accept `gif` options for generation and editing, with optional `frame_count` and `frame_duration_ms` controls. Use `gif: {}` for API defaults.
- Preserve animated output with `.gif` filenames and `image/gif` data URLs while providing a still preview to the model.
- Add guidance for simple animations and spritesheet-based GIF edits.
## Testing
Add integration coverage for GIF generation and editing, explicit frame controls and API defaults, saved animation bytes, and still-preview replay across follow-up turns.
GitOrigin-RevId: 08afa0316ae3675921652157836191a649f563cf
This commit is contained in:
@@ -262,6 +262,7 @@ mod tests {
|
||||
let (response, imagegen_request_id) = client
|
||||
.generate(
|
||||
&ImageGenerationRequest {
|
||||
output: None,
|
||||
prompt: "a red fox in a field".to_string(),
|
||||
background: Some(ImageBackground::Opaque),
|
||||
model: "gpt-image-1.5".to_string(),
|
||||
@@ -311,6 +312,7 @@ mod tests {
|
||||
let (response, _) = client
|
||||
.generate(
|
||||
&ImageGenerationRequest {
|
||||
output: None,
|
||||
prompt: "test".to_string(),
|
||||
background: None,
|
||||
model: "gpt-image-2".to_string(),
|
||||
@@ -341,6 +343,7 @@ mod tests {
|
||||
let (response, imagegen_request_id) = client
|
||||
.edit(
|
||||
&ImageEditRequest {
|
||||
output: None,
|
||||
images: vec![
|
||||
ImageReference::Inline {
|
||||
image_url: "data:image/png;base64,Zm9v".to_string(),
|
||||
@@ -389,6 +392,7 @@ mod tests {
|
||||
let error = client
|
||||
.generate(
|
||||
&ImageGenerationRequest {
|
||||
output: None,
|
||||
prompt: "a red fox in a field".to_string(),
|
||||
background: None,
|
||||
model: "gpt-image-1.5".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user