Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(image): support animated GIF output for GPT Image models (#22306)

YuTengjing6165ec8f34a5
diff --git a/locales/ar/image.json b/locales/ar/image.json
index c4d0fd2a0ea..e8324e7170c 100644
--- a/locales/ar/image.json
+++ b/locales/ar/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "قفل نسبة العرض إلى الارتفاع",
"config.aspectRatio.unlock": "فتح نسبة العرض إلى الارتفاع",
"config.cfg.label": "شدة التوجيه",
+ "config.frameCount.label": "إطارات",
+ "config.frameDurationMs.label": "مدة الإطار (مللي ثانية)",
"config.header.desc": "وصف موجز، أنشئ فورًا",
"config.header.title": "رسم",
"config.height.label": "الارتفاع",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "صورة مرجعية",
"config.imageUrls.label": "صور مرجعية",
"config.model.label": "النموذج",
+ "config.outputFormat.gifRefUnsupported": "قم بإزالة صور المرجع أولاً",
+ "config.outputFormat.label": "تنسيق الإخراج",
+ "config.outputFormat.options.gif": "متحرك (GIF)",
+ "config.outputFormat.options.png": "ثابت (PNG)",
"config.prompt.placeholder": "صف ما ترغب في إنشائه",
"config.prompt.placeholderWithRef": "وصف كيف تريد تعديل الصورة",
"config.promptExtend.label": "توسيع المطلب",
diff --git a/locales/bg-BG/image.json b/locales/bg-BG/image.json
index c54eae9d11a..3da30ed61d8 100644
--- a/locales/bg-BG/image.json
+++ b/locales/bg-BG/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Заключи съотношението",
"config.aspectRatio.unlock": "Отключи съотношението",
"config.cfg.label": "Интензитет на насоките",
+ "config.frameCount.label": "Кадри",
+ "config.frameDurationMs.label": "Продължителност на кадър (ms)",
"config.header.desc": "Кратко описание, създай незабавно",
"config.header.title": "Картина",
"config.height.label": "Височина",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Референтно изображение",
"config.imageUrls.label": "Референтни изображения",
"config.model.label": "Модел",
+ "config.outputFormat.gifRefUnsupported": "Първо премахнете референтните изображения",
+ "config.outputFormat.label": "Формат на изхода",
+ "config.outputFormat.options.gif": "Анимиран (GIF)",
+ "config.outputFormat.options.png": "Статичен (PNG)",
"config.prompt.placeholder": "Опишете какво искате да генерирате",
"config.prompt.placeholderWithRef": "Опишете как искате да промените изображението",
"config.promptExtend.label": "Разширяване на подсказката",
diff --git a/locales/de-DE/image.json b/locales/de-DE/image.json
index ed92dc9faac..8709e4d2f05 100644
--- a/locales/de-DE/image.json
+++ b/locales/de-DE/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Seitenverhältnis sperren",
"config.aspectRatio.unlock": "Seitenverhältnis entsperren",
"config.cfg.label": "Intensität der Anleitung",
+ "config.frameCount.label": "Frames",
+ "config.frameDurationMs.label": "Frame-Dauer (ms)",
"config.header.desc": "Kurze Beschreibung, sofort erstellen",
"config.header.title": "Gemälde",
"config.height.label": "Höhe",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Referenzbild",
"config.imageUrls.label": "Referenzbilder",
"config.model.label": "Modell",
+ "config.outputFormat.gifRefUnsupported": "Referenzbilder zuerst entfernen",
+ "config.outputFormat.label": "Ausgabeformat",
+ "config.outputFormat.options.gif": "Animiert (GIF)",
+ "config.outputFormat.options.png": "Statisch (PNG)",
"config.prompt.placeholder": "Beschreiben Sie, was Sie generieren möchten",
"config.prompt.placeholderWithRef": "Beschreiben Sie, wie Sie das Bild anpassen möchten",
"config.promptExtend.label": "Prompt-Erweiterung",
diff --git a/locales/en-US/image.json b/locales/en-US/image.json
index b14d63fdaf2..4846254af2a 100644
--- a/locales/en-US/image.json
+++ b/locales/en-US/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Lock Aspect Ratio",
"config.aspectRatio.unlock": "Unlock Aspect Ratio",
"config.cfg.label": "Guidance Intensity",
+ "config.frameCount.label": "Frames",
+ "config.frameDurationMs.label": "Frame Duration (ms)",
"config.header.desc": "Brief description, create instantly",
"config.header.title": "Image",
"config.height.label": "Height",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Reference Image",
"config.imageUrls.label": "Reference Images",
"config.model.label": "Model",
+ "config.outputFormat.gifRefUnsupported": "Remove reference images first",
+ "config.outputFormat.label": "Output Format",
+ "config.outputFormat.options.gif": "Animated (GIF)",
+ "config.outputFormat.options.png": "Static (PNG)",
"config.prompt.placeholder": "Describe what you want to generate",
"config.prompt.placeholderWithRef": "Describe how you want to adjust the image",
"config.promptExtend.label": "Prompt Extend",
diff --git a/locales/es-ES/image.json b/locales/es-ES/image.json
index ebd3dd3ff65..6328487078b 100644
--- a/locales/es-ES/image.json
+++ b/locales/es-ES/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Bloquear relación de aspecto",
"config.aspectRatio.unlock": "Desbloquear relación de aspecto",
"config.cfg.label": "Intensidad de guía",
+ "config.frameCount.label": "Fotogramas",
+ "config.frameDurationMs.label": "Duración del fotograma (ms)",
"config.header.desc": "Descripción breve, crea al instante",
"config.header.title": "Pintura",
"config.height.label": "Altura",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Imagen de referencia",
"config.imageUrls.label": "Imágenes de referencia",
"config.model.label": "Modelo",
+ "config.outputFormat.gifRefUnsupported": "Elimina primero las imágenes de referencia",
+ "config.outputFormat.label": "Formato de salida",
+ "config.outputFormat.options.gif": "Animado (GIF)",
+ "config.outputFormat.options.png": "Estático (PNG)",
"config.prompt.placeholder": "Describe lo que deseas generar",
"config.prompt.placeholderWithRef": "Describe cómo quieres ajustar la imagen",
"config.promptExtend.label": "Extensión de indicaciones",
diff --git a/locales/fa-IR/image.json b/locales/fa-IR/image.json
index 15b3bcbb7b4..83d18ae0bc6 100644
--- a/locales/fa-IR/image.json
+++ b/locales/fa-IR/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "قفل نسبت تصویر",
"config.aspectRatio.unlock": "باز کردن قفل نسبت تصویر",
"config.cfg.label": "شدت راهنمایی",
+ "config.frameCount.label": "فریم‌ها",
+ "config.frameDurationMs.label": "مدت زمان فریم (میلی‌ثانیه)",
"config.header.desc": "توضیح کوتاه، ایجاد فوری",
"config.header.title": "نقاشی",
"config.height.label": "ارتفاع",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "تصویر مرجع",
"config.imageUrls.label": "تصاویر مرجع",
"config.model.label": "مدل",
+ "config.outputFormat.gifRefUnsupported": "ابتدا تصاویر مرجع را حذف کنید",
+ "config.outputFormat.label": "فرمت خروجی",
+ "config.outputFormat.options.gif": "متحرک (GIF)",
+ "config.outputFormat.options.png": "ثابت (PNG)",
"config.prompt.placeholder": "توصیف کنید که چه چیزی می‌خواهید تولید شود",
"config.prompt.placeholderWithRef": "توضیح دهید که چگونه می‌خواهید تصویر را تنظیم کنید",
"config.promptExtend.label": "گسترش پرامپت",
diff --git a/locales/fr-FR/image.json b/locales/fr-FR/image.json
index 67b52facd92..dd6519cab07 100644
--- a/locales/fr-FR/image.json
+++ b/locales/fr-FR/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Verrouiller le format",
"config.aspectRatio.unlock": "Déverrouiller le format",
"config.cfg.label": "Intensité de la guidance",
+ "config.frameCount.label": "Images",
+ "config.frameDurationMs.label": "Durée de l'image (ms)",
"config.header.desc": "Brève description, création instantanée",
"config.header.title": "Peinture",
"config.height.label": "Hauteur",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Image de référence",
"config.imageUrls.label": "Images de référence",
"config.model.label": "Modèle",
+ "config.outputFormat.gifRefUnsupported": "Supprimez d'abord les images de référence",
+ "config.outputFormat.label": "Format de sortie",
+ "config.outputFormat.options.gif": "Animé (GIF)",
+ "config.outputFormat.options.png": "Statique (PNG)",
"config.prompt.placeholder": "Décrivez ce que vous souhaitez générer",
"config.prompt.placeholderWithRef": "Décrivez comment vous souhaitez ajuster l'image",
"config.promptExtend.label": "Extension de l’invite",
diff --git a/locales/it-IT/image.json b/locales/it-IT/image.json
index 6f348efb1c0..ce8a263e2a5 100644
--- a/locales/it-IT/image.json
+++ b/locales/it-IT/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Blocca proporzioni",
"config.aspectRatio.unlock": "Sblocca proporzioni",
"config.cfg.label": "Intensità guida",
+ "config.frameCount.label": "Fotogrammi",
+ "config.frameDurationMs.label": "Durata fotogramma (ms)",
"config.header.desc": "Descrizione breve, crea istantaneamente",
"config.header.title": "Dipinto",
"config.height.label": "Altezza",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Immagine di riferimento",
"config.imageUrls.label": "Immagini di riferimento",
"config.model.label": "Modello",
+ "config.outputFormat.gifRefUnsupported": "Rimuovi prima le immagini di riferimento",
+ "config.outputFormat.label": "Formato di output",
+ "config.outputFormat.options.gif": "Animato (GIF)",
+ "config.outputFormat.options.png": "Statico (PNG)",
"config.prompt.placeholder": "Descrivi cosa vuoi generare",
"config.prompt.placeholderWithRef": "Descrivi come desideri modificare l'immagine",
"config.promptExtend.label": "Estensione Prompt",
diff --git a/locales/ja-JP/image.json b/locales/ja-JP/image.json
index 0410a1887a9..ed6cc1971ee 100644
--- a/locales/ja-JP/image.json
+++ b/locales/ja-JP/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "アスペクト比を固定する",
"config.aspectRatio.unlock": "アスペクト比の固定を解除する",
"config.cfg.label": "ガイド強度",
+ "config.frameCount.label": "フレーム数",
+ "config.frameDurationMs.label": "フレームの持続時間 (ms)",
"config.header.desc": "簡単な説明、すぐに創作",
"config.header.title": "絵画",
"config.height.label": "高さ",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "参考画像",
"config.imageUrls.label": "参考画像",
"config.model.label": "モデル",
+ "config.outputFormat.gifRefUnsupported": "参照画像を先に削除してください",
+ "config.outputFormat.label": "出力形式",
+ "config.outputFormat.options.gif": "アニメーション (GIF)",
+ "config.outputFormat.options.png": "静止画 (PNG)",
"config.prompt.placeholder": "生成したい内容を記述してください",
"config.prompt.placeholderWithRef": "画像をどのように調整したいか説明してください",
"config.promptExtend.label": "プロンプト拡張",
diff --git a/locales/ko-KR/image.json b/locales/ko-KR/image.json
index 66d04188953..2ee7efd7098 100644
--- a/locales/ko-KR/image.json
+++ b/locales/ko-KR/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "가로세로 비율 잠금",
"config.aspectRatio.unlock": "가로세로 비율 잠금 해제",
"config.cfg.label": "가이던스 강도",
+ "config.frameCount.label": "프레임 수",
+ "config.frameDurationMs.label": "프레임 지속 시간 (ms)",
"config.header.desc": "간단한 설명으로 바로 창작 시작",
"config.header.title": "그림 그리기",
"config.height.label": "높이",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "참고 이미지",
"config.imageUrls.label": "참고 이미지",
"config.model.label": "모델",
+ "config.outputFormat.gifRefUnsupported": "참조 이미지를 먼저 제거하세요",
+ "config.outputFormat.label": "출력 형식",
+ "config.outputFormat.options.gif": "애니메이션 (GIF)",
+ "config.outputFormat.options.png": "정적 (PNG)",
"config.prompt.placeholder": "생성하고 싶은 내용을 설명하세요",
"config.prompt.placeholderWithRef": "이미지를 어떻게 조정하고 싶은지 설명하세요",
"config.promptExtend.label": "프롬프트 확장",
diff --git a/locales/nl-NL/image.json b/locales/nl-NL/image.json
index 4ab8fddcbd5..50e869c9067 100644
--- a/locales/nl-NL/image.json
+++ b/locales/nl-NL/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Beeldverhouding vergrendelen",
"config.aspectRatio.unlock": "Beeldverhouding ontgrendelen",
"config.cfg.label": "Intensiteit van begeleiding",
+ "config.frameCount.label": "Frames",
+ "config.frameDurationMs.label": "Frame Duur (ms)",
"config.header.desc": "Korte beschrijving, direct creëren",
"config.header.title": "Schilderij",
"config.height.label": "Hoogte",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Referentieafbeelding",
"config.imageUrls.label": "Referentieafbeeldingen",
"config.model.label": "Model",
+ "config.outputFormat.gifRefUnsupported": "Verwijder eerst referentieafbeeldingen",
+ "config.outputFormat.label": "Uitvoerformaat",
+ "config.outputFormat.options.gif": "Geanimeerd (GIF)",
+ "config.outputFormat.options.png": "Statisch (PNG)",
"config.prompt.placeholder": "Beschrijf wat je wilt genereren",
"config.prompt.placeholderWithRef": "Beschrijf hoe u de afbeelding wilt aanpassen",
"config.promptExtend.label": "Prompt uitbreiden",
diff --git a/locales/pl-PL/image.json b/locales/pl-PL/image.json
index 23cd917eb13..1dcc41d075a 100644
--- a/locales/pl-PL/image.json
+++ b/locales/pl-PL/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Zablokuj proporcje",
"config.aspectRatio.unlock": "Odblokuj proporcje",
"config.cfg.label": "Intensywność wskazówek",
+ "config.frameCount.label": "Klatki",
+ "config.frameDurationMs.label": "Czas trwania klatki (ms)",
"config.header.desc": "Krótki opis, twórz natychmiast",
"config.header.title": "Obraz",
"config.height.label": "Wysokość",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Obraz referencyjny",
"config.imageUrls.label": "Obrazy referencyjne",
"config.model.label": "Model",
+ "config.outputFormat.gifRefUnsupported": "Najpierw usuń obrazy referencyjne",
+ "config.outputFormat.label": "Format wyjściowy",
+ "config.outputFormat.options.gif": "Animowany (GIF)",
+ "config.outputFormat.options.png": "Statyczny (PNG)",
"config.prompt.placeholder": "Opisz, co chcesz wygenerować",
"config.prompt.placeholderWithRef": "Opisz, jak chcesz dostosować obraz",
"config.promptExtend.label": "Rozszerzenie promptu",
diff --git a/locales/pt-BR/image.json b/locales/pt-BR/image.json
index c75f2a37be3..b5a522ef8e0 100644
--- a/locales/pt-BR/image.json
+++ b/locales/pt-BR/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Bloquear Proporção",
"config.aspectRatio.unlock": "Desbloquear Proporção",
"config.cfg.label": "Intensidade da Orientação",
+ "config.frameCount.label": "Quadros",
+ "config.frameDurationMs.label": "Duração do Quadro (ms)",
"config.header.desc": "Descrição breve, crie instantaneamente",
"config.header.title": "Pintura",
"config.height.label": "Altura",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Imagem de Referência",
"config.imageUrls.label": "Imagens de Referência",
"config.model.label": "Modelo",
+ "config.outputFormat.gifRefUnsupported": "Remova as imagens de referência primeiro",
+ "config.outputFormat.label": "Formato de Saída",
+ "config.outputFormat.options.gif": "Animado (GIF)",
+ "config.outputFormat.options.png": "Estático (PNG)",
"config.prompt.placeholder": "Descreva o que você deseja gerar",
"config.prompt.placeholderWithRef": "Descreva como você deseja ajustar a imagem",
"config.promptExtend.label": "Extensão de Prompt",
diff --git a/locales/ru-RU/image.json b/locales/ru-RU/image.json
index bb6f3ad045c..097ccdcda30 100644
--- a/locales/ru-RU/image.json
+++ b/locales/ru-RU/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Зафиксировать соотношение сторон",
"config.aspectRatio.unlock": "Разблокировать соотношение сторон",
"config.cfg.label": "Интенсивность направляющих",
+ "config.frameCount.label": "Кадры",
+ "config.frameDurationMs.label": "Длительность кадра (мс)",
"config.header.desc": "Краткое описание, создайте мгновенно",
"config.header.title": "Картина",
"config.height.label": "Высота",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Референсное изображение",
"config.imageUrls.label": "Референсные изображения",
"config.model.label": "Модель",
+ "config.outputFormat.gifRefUnsupported": "Сначала удалите эталонные изображения",
+ "config.outputFormat.label": "Формат вывода",
+ "config.outputFormat.options.gif": "Анимация (GIF)",
+ "config.outputFormat.options.png": "Статичный (PNG)",
"config.prompt.placeholder": "Опишите, что вы хотите сгенерировать",
"config.prompt.placeholderWithRef": "Опишите, как вы хотите изменить изображение",
"config.promptExtend.label": "Расширение подсказки",
diff --git a/locales/tr-TR/image.json b/locales/tr-TR/image.json
index e1764f3a3a9..074492c744f 100644
--- a/locales/tr-TR/image.json
+++ b/locales/tr-TR/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "En Boy Oranını Kilitle",
"config.aspectRatio.unlock": "En Boy Oranını Kilidi Aç",
"config.cfg.label": "Yönlendirme Yoğunluğu",
+ "config.frameCount.label": "Kareler",
+ "config.frameDurationMs.label": "Kare Süresi (ms)",
"config.header.desc": "Kısa açıklama, anında oluştur",
"config.header.title": "Resim",
"config.height.label": "Yükseklik",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Referans Görsel",
"config.imageUrls.label": "Referans Görseller",
"config.model.label": "Model",
+ "config.outputFormat.gifRefUnsupported": "Önce referans görüntüleri kaldırın",
+ "config.outputFormat.label": "Çıktı Formatı",
+ "config.outputFormat.options.gif": "Animasyonlu (GIF)",
+ "config.outputFormat.options.png": "Statik (PNG)",
"config.prompt.placeholder": "Oluşturmak istediğinizi tanımlayın",
"config.prompt.placeholderWithRef": "Resmi nasıl ayarlamak istediğinizi açıklayın",
"config.promptExtend.label": "İstem Genişletme",
diff --git a/locales/vi-VN/image.json b/locales/vi-VN/image.json
index f3fa71326bc..b6ad03c9330 100644
--- a/locales/vi-VN/image.json
+++ b/locales/vi-VN/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "Khóa tỷ lệ khung hình",
"config.aspectRatio.unlock": "Mở khóa tỷ lệ khung hình",
"config.cfg.label": "Cường độ hướng dẫn",
+ "config.frameCount.label": "Khung hình",
+ "config.frameDurationMs.label": "Thời lượng khung hình (ms)",
"config.header.desc": "Mô tả ngắn gọn, tạo ngay lập tức",
"config.header.title": "Tranh vẽ",
"config.height.label": "Chiều cao",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "Ảnh tham khảo",
"config.imageUrls.label": "Các ảnh tham khảo",
"config.model.label": "Mô hình",
+ "config.outputFormat.gifRefUnsupported": "Hãy xóa hình ảnh tham chiếu trước",
+ "config.outputFormat.label": "Định dạng đầu ra",
+ "config.outputFormat.options.gif": "Hoạt hình (GIF)",
+ "config.outputFormat.options.png": "Tĩnh (PNG)",
"config.prompt.placeholder": "Mô tả những gì bạn muốn tạo",
"config.prompt.placeholderWithRef": "Mô tả cách bạn muốn điều chỉnh hình ảnh",
"config.promptExtend.label": "Mở rộng Prompt",
diff --git a/locales/zh-CN/image.json b/locales/zh-CN/image.json
index 14a93c0344e..1f32e818108 100644
--- a/locales/zh-CN/image.json
+++ b/locales/zh-CN/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "锁定宽高比",
"config.aspectRatio.unlock": "解锁宽高比",
"config.cfg.label": "引导强度",
+ "config.frameCount.label": "帧数",
+ "config.frameDurationMs.label": "每帧时长(毫秒)",
"config.header.desc": "简单描述,即刻创作",
"config.header.title": "图片",
"config.height.label": "高度",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "参考图",
"config.imageUrls.label": "参考图",
"config.model.label": "模型",
+ "config.outputFormat.gifRefUnsupported": "需先移除参考图",
+ "config.outputFormat.label": "输出格式",
+ "config.outputFormat.options.gif": "动图(GIF)",
+ "config.outputFormat.options.png": "静态图(PNG)",
"config.prompt.placeholder": "描述你想要生成的内容",
"config.prompt.placeholderWithRef": "描述你想如何调整图片",
"config.promptExtend.label": "提示扩展",
diff --git a/locales/zh-TW/image.json b/locales/zh-TW/image.json
index 479fda8bb04..d1d7282106e 100644
--- a/locales/zh-TW/image.json
+++ b/locales/zh-TW/image.json
@@ -3,6 +3,8 @@
"config.aspectRatio.lock": "鎖定寬高比",
"config.aspectRatio.unlock": "解鎖寬高比",
"config.cfg.label": "引導強度",
+ "config.frameCount.label": "幀數",
+ "config.frameDurationMs.label": "幀持續時間(毫秒)",
"config.header.desc": "簡單描述,即刻創作",
"config.header.title": "繪畫",
"config.height.label": "高度",
@@ -11,6 +13,10 @@
"config.imageUrl.label": "參考圖",
"config.imageUrls.label": "參考圖",
"config.model.label": "模型",
+ "config.outputFormat.gifRefUnsupported": "請先移除參考圖片",
+ "config.outputFormat.label": "輸出格式",
+ "config.outputFormat.options.gif": "動畫(GIF)",
+ "config.outputFormat.options.png": "靜態(PNG)",
"config.prompt.placeholder": "描述你想要生成的內容",
"config.prompt.placeholderWithRef": "描述您希望如何調整圖片",
"config.promptExtend.label": "提示延伸",
diff --git a/packages/locales/src/default/image.ts b/packages/locales/src/default/image.ts
index 3d9740f6ce5..6528ca2ed3c 100644
--- a/packages/locales/src/default/image.ts
+++ b/packages/locales/src/default/image.ts
@@ -5,6 +5,8 @@ export default {
'config.cfg.label': 'Guidance Intensity',
'config.header.desc': 'Brief description, create instantly',
'config.header.title': 'Image',
+ 'config.frameCount.label': 'Frames',
+ 'config.frameDurationMs.label': 'Frame Duration (ms)',
'config.height.label': 'Height',
'config.imageNum.label': 'Number of Images',
'config.imageUpload.maxCountReached': 'You can add up to {{count}} reference images',
@@ -15,6 +17,10 @@ export default {
'config.promptExtend.options.fast': 'Fast',
'config.promptExtend.options.off': 'Off',
'config.promptExtend.options.standard': 'Standard',
+ 'config.outputFormat.gifRefUnsupported': 'Remove reference images first',
+ 'config.outputFormat.label': 'Output Format',
+ 'config.outputFormat.options.gif': 'Animated (GIF)',
+ 'config.outputFormat.options.png': 'Static (PNG)',
'config.prompt.placeholder': 'Describe what you want to generate',
'config.prompt.placeholderWithRef': 'Describe how you want to adjust the image',
'config.quality.label': 'Image Quality',
diff --git a/packages/model-bank/src/standard-parameters/index.ts b/packages/model-bank/src/standard-parameters/index.ts
index 5fe0bc17c94..62dcf8ba08d 100644
--- a/packages/model-bank/src/standard-parameters/index.ts
+++ b/packages/model-bank/src/standard-parameters/index.ts
@@ -253,6 +253,43 @@ export const ModelParamsMetaSchema = z.object({
})
.optional(),
+ /**
+ * Output file format, e.g. `png` or `gif`. `gif` produces an animated image whose
+ * frames are controlled by `frameCount` and `frameDurationMs`.
+ */
+ outputFormat: z
+ .object({
+ default: z.string(),
+ description: z.string().optional(),
+ enum: z.array(z.string()),
+ type: z.literal('string').optional(),
+ })
+ .optional(),
+
+ /** Number of frames in an animated output; only sent when `outputFormat` is `gif`. */
+ frameCount: z
+ .object({
+ default: z.number(),
+ description: z.string().optional(),
+ max: z.number(),
+ min: z.number(),
+ step: z.number().optional().default(1),
+ type: z.literal('number').optional(),
+ })
+ .optional(),
+
+ /** Milliseconds each animated frame is shown; only sent when `outputFormat` is `gif`. */
+ frameDurationMs: z
+ .object({
+ default: z.number(),
+ description: z.string().optional(),
+ max: z.number(),
+ min: z.number(),
+ step: z.number().optional().default(1),
+ type: z.literal('number').optional(),
+ })
+ .optional(),
+
promptExtend: z
.object({
default: z.union([z.boolean(), z.string()]),
diff --git a/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.test.ts b/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.test.ts
index 442b895358e..ecdb1aa3459 100644
--- a/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.test.ts
+++ b/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.test.ts
@@ -1,9 +1,9 @@
// @vitest-environment node
-import * as imageToBase64Module from '../../utils/imageToBase64';
import type OpenAI from 'openai';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import type { CreateImagePayload } from '../../types/image';
+import * as imageToBase64Module from '../../utils/imageToBase64';
import * as uriParserModule from '../../utils/uriParser';
import { createOpenAICompatibleImage } from './createImage';
@@ -842,6 +842,67 @@ describe('createOpenAICompatibleImage', () => {
});
});
+ describe('image mode - animated GIF output', () => {
+ it('sends GIF fields in snake_case and returns a GIF data URI', async () => {
+ vi.mocked(mockClient.images.generate).mockResolvedValue({
+ data: [{ b64_json: 'R0lGODlh' }],
+ output_format: 'gif',
+ } as any);
+
+ const result = await createOpenAICompatibleImage(
+ mockClient,
+ {
+ model: 'gpt-image-2.6-flare',
+ params: { frameCount: 12, frameDurationMs: 120, outputFormat: 'gif', prompt: 'a cat' },
+ },
+ 'openai',
+ );
+
+ const args = vi.mocked(mockClient.images.generate).mock.calls[0][0] as any;
+ expect(args).toMatchObject({ frame_count: 12, frame_duration_ms: 120, output_format: 'gif' });
+ expect(args).not.toHaveProperty('frameCount');
+ expect(result.imageUrl).toBe('data:image/gif;base64,R0lGODlh');
+ });
+
+ it('drops frame fields for static output', async () => {
+ vi.mocked(mockClient.images.generate).mockResolvedValue({
+ data: [{ b64_json: 'png' }],
+ } as any);
+
+ const result = await createOpenAICompatibleImage(
+ mockClient,
+ {
+ model: 'gpt-image-2.6-flare',
+ params: { frameCount: 9, frameDurationMs: 200, outputFormat: 'png', prompt: 'a cat' },
+ },
+ 'openai',
+ );
+
+ const args = vi.mocked(mockClient.images.generate).mock.calls[0][0] as any;
+ expect(args.output_format).toBe('png');
+ expect(args).not.toHaveProperty('frame_count');
+ expect(args).not.toHaveProperty('frame_duration_ms');
+ expect(result.imageUrl).toBe('data:image/png;base64,png');
+ });
+
+ it('rejects GIF output with reference images before downloading them', async () => {
+ global.fetch = vi.fn();
+
+ await expect(
+ createOpenAICompatibleImage(
+ mockClient,
+ {
+ model: 'gpt-image-2.6-flare',
+ params: { imageUrls: ['https://example.com/a.png'], outputFormat: 'gif', prompt: 'p' },
+ },
+ 'openai',
+ ),
+ ).rejects.toThrow('Animated GIF output does not support reference images');
+ expect(global.fetch).not.toHaveBeenCalled();
+ expect(mockClient.images.edit).not.toHaveBeenCalled();
+ });
+ });
+
describe('image mode - usage tracking', () => {
it('should include modelUsage when usage is present in response', async () => {
const mockImageResponse = {
diff --git a/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.ts b/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.ts
index 145d27d8115..cb370591052 100644
--- a/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.ts
+++ b/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.ts
@@ -1,4 +1,3 @@
-import { cleanObject } from '../../utils/object';
import createDebug from 'debug';
import type { RuntimeImageGenParamsValue } from 'model-bank';
import type OpenAI from 'openai';
@@ -9,10 +8,12 @@ import type {
CreateImageResponse,
} from '../../types/image';
import { getModelPricing } from '../../utils/getModelPricing';
+import { cleanObject } from '../../utils/object';
import { referenceImageUrlToBase64 } from '../../utils/referenceImageCache';
import { parseDataUri } from '../../utils/uriParser';
import { convertImageUrlToFile } from '../contextBuilders/openai';
import { convertOpenAIImageUsage } from '../usageConverters/openai';
+import { applyImageOutputParams, resolveImageOutputMimeType } from './imageOutputParams';
const log = createDebug('lobe-image:openai-compatible');
@@ -63,6 +64,8 @@ async function generateByImageMode(
// https://platform.openai.com/docs/api-reference/images/createEdit
const isImageEdit = Array.isArray(userInput.image) && userInput.image.length > 0;
log('isImageEdit: %O, userInput.image: %O', isImageEdit, userInput.image);
+ // Validate output controls before downloading reference images: GIF + edit fails anyway.
+ applyImageOutputParams(userInput, { isImageEdit });
// If there are imageUrls parameters, convert them to File objects
if (isImageEdit) {
try {
@@ -126,8 +129,12 @@ async function generateByImageMode(
// Handle base64 format response
if (imageData.b64_json) {
- // Determine the image's MIME type, default to PNG
- const mimeType = 'image/png'; // OpenAI image generation defaults to PNG format
+ // GIF/JPEG/WebP outputs must keep their real MIME type: storage derives the file extension
+ // and served Content-Type from it, so a GIF labelled PNG would no longer animate.
+ const mimeType = resolveImageOutputMimeType(
+ (img as { output_format?: string }).output_format,
+ userInput.output_format,
+ );
// Convert base64 string to complete data URL
imageUrl = `data:${mimeType};base64,${imageData.b64_json}`;
diff --git a/packages/model-runtime/src/core/openaiCompatibleFactory/imageOutputParams.test.ts b/packages/model-runtime/src/core/openaiCompatibleFactory/imageOutputParams.test.ts
new file mode 100644
index 00000000000..cb76bc95f41
--- /dev/null
+++ b/packages/model-runtime/src/core/openaiCompatibleFactory/imageOutputParams.test.ts
@@ -0,0 +1,61 @@
+import { describe, expect, it } from 'vitest';
+
+import {
+ applyImageOutputParams,
+ GIF_EDIT_UNSUPPORTED_MESSAGE,
+ resolveImageOutputMimeType,
+} from './imageOutputParams';
+
+describe('applyImageOutputParams', () => {
+ it('renames GIF output controls to Images API fields', () => {
+ const input: Record<string, any> = {
+ frameCount: 12,
+ frameDurationMs: 120,
+ outputFormat: 'gif',
+ prompt: 'a cat',
+ };
+
+ applyImageOutputParams(input, { isImageEdit: false });
+
+ expect(input).toEqual({
+ frame_count: 12,
+ frame_duration_ms: 120,
+ output_format: 'gif',
+ prompt: 'a cat',
+ });
+ });
+
+ it('drops frame fields when the output is not a GIF', () => {
+ const input: Record<string, any> = { frameCount: 9, frameDurationMs: 200, outputFormat: 'png' };
+
+ applyImageOutputParams(input, { isImageEdit: true });
+
+ expect(input).toEqual({ output_format: 'png' });
+ });
+
+ it('drops frame fields when no output format is requested', () => {
+ const input: Record<string, any> = { frameCount: 9, prompt: 'p' };
+
+ applyImageOutputParams(input, { isImageEdit: false });
+
+ expect(input).toEqual({ prompt: 'p' });
+ });
+
+ it('rejects GIF output on the edit endpoint', () => {
+ expect(() =>
+ applyImageOutputParams({ outputFormat: 'gif' }, { isImageEdit: true }),
+ ).toThrowError(GIF_EDIT_UNSUPPORTED_MESSAGE);
+ });
+});
+
+describe('resolveImageOutputMimeType', () => {
+ it('prefers the format reported by the response', () => {
+ expect(resolveImageOutputMimeType('gif', 'png')).toBe('image/gif');
+ });
+
+ it('falls back to the requested format, then PNG', () => {
+ expect(resolveImageOutputMimeType(undefined, 'webp')).toBe('image/webp');
+ expect(resolveImageOutputMimeType(undefined, undefined)).toBe('image/png');
+ expect(resolveImageOutputMimeType('unknown', null)).toBe('image/png');
+ });
+});
diff --git a/packages/model-runtime/src/core/openaiCompatibleFactory/imageOutputParams.ts b/packages/model-runtime/src/core/openaiCompatibleFactory/imageOutputParams.ts
new file mode 100644
index 00000000000..fc1642acdd2
--- /dev/null
+++ b/packages/model-runtime/src/core/openaiCompatibleFactory/imageOutputParams.ts
@@ -0,0 +1,60 @@
+/**
+ * OpenAI Images API output controls shared by the OpenAI-compatible and Azure OpenAI runtimes.
+ *
+ * Standard image params are camelCase, while the Images API expects snake_case fields.
+ * Animated GIF output (GPT Image 2.6) is only available on `v1/images/generations`; the edit
+ * endpoint rejects it, and the frame fields are only valid together with `output_format: "gif"`.
+ * @see https://developers.openai.com/api/docs/guides/image-generation
+ */
+
+const OUTPUT_PARAM_FIELDS = {
+ frameCount: 'frame_count',
+ frameDurationMs: 'frame_duration_ms',
+ outputFormat: 'output_format',
+} as const;
+
+const GIF_ONLY_FIELDS = ['frame_count', 'frame_duration_ms'] as const;
+
+const OUTPUT_FORMAT_MIME_TYPES: Record<string, string> = {
+ gif: 'image/gif',
+ jpeg: 'image/jpeg',
+ png: 'image/png',
+ webp: 'image/webp',
+};
+
+export const GIF_EDIT_UNSUPPORTED_MESSAGE =
+ 'Animated GIF output does not support reference images. Remove the reference images or choose another output format.';
+
+/**
+ * Rename output controls to Images API fields in place and drop frame fields unless the
+ * request asks for a GIF. Throws when a GIF is requested on the edit endpoint.
+ */
+export const applyImageOutputParams = (
+ userInput: Record<string, any>,
+ { isImageEdit }: { isImageEdit: boolean },
+): void => {
+ for (const [paramName, field] of Object.entries(OUTPUT_PARAM_FIELDS)) {
+ if (!(paramName in userInput)) continue;
+ userInput[field] = userInput[paramName];
+ delete userInput[paramName];
+ }
+
+ if (userInput.output_format === 'gif') {
+ if (isImageEdit) throw new Error(GIF_EDIT_UNSUPPORTED_MESSAGE);
+ return;
+ }
+
+ for (const field of GIF_ONLY_FIELDS) delete userInput[field];
+};
+
+/**
+ * MIME type for a base64 image result. The response reports the format it produced; fall back to
+ * the requested format, then to PNG, the Images API default.
+ */
+export const resolveImageOutputMimeType = (
+ responseFormat?: string | null,
+ requestedFormat?: string | null,
+): string =>
+ OUTPUT_FORMAT_MIME_TYPES[responseFormat ?? ''] ??
+ OUTPUT_FORMAT_MIME_TYPES[requestedFormat ?? ''] ??
+ 'image/png';
diff --git a/packages/model-runtime/src/core/usageConverters/index.ts b/packages/model-runtime/src/core/usageConverters/index.ts
index 9e41d4033e1..625f4ac0288 100644
--- a/packages/model-runtime/src/core/usageConverters/index.ts
+++ b/packages/model-runtime/src/core/usageConverters/index.ts
@@ -37,7 +37,10 @@ export {
estimateOpenAIChatInputTokens,
type EstimateOpenAIChatInputTokensOptions,
} from './utils/estimateChatCost';
-export { resolveImageSinglePrice } from './utils/resolveImageSinglePrice';
+export {
+ type ImageSinglePriceParams,
+ resolveImageSinglePrice,
+} from './utils/resolveImageSinglePrice';
export { resolveVideoSinglePrice } from './utils/resolveVideoSinglePrice';
export {
countVideoOutputTokens,
diff --git a/packages/model-runtime/src/core/usageConverters/utils/resolveImageSinglePrice.test.ts b/packages/model-runtime/src/core/usageConverters/utils/resolveImageSinglePrice.test.ts
new file mode 100644
index 00000000000..7c66b3ebb39
--- /dev/null
+++ b/packages/model-runtime/src/core/usageConverters/utils/resolveImageSinglePrice.test.ts
@@ -0,0 +1,50 @@
+import type { Pricing } from 'model-bank';
+import { describe, expect, it } from 'vitest';
+
+import { resolveImagePriceMultiplier, resolveImageSinglePrice } from './resolveImageSinglePrice';
+
+const tokenPricing: Pricing = {
+ approximatePricePerImage: 0.035,
+ units: [{ name: 'imageOutput', rate: 34.8, strategy: 'fixed', unit: 'millionTokens' }],
+};
+
+describe('resolveImagePriceMultiplier', () => {
+ it('counts static output as one image', () => {
+ expect(resolveImagePriceMultiplier()).toBe(1);
+ expect(resolveImagePriceMultiplier({ frameCount: 64, outputFormat: 'png' })).toBe(1);
+ });
+
+ it('scales GIF output with its frame count, never below one image', () => {
+ expect(resolveImagePriceMultiplier({ frameCount: 14, outputFormat: 'gif' })).toBe(2);
+ expect(resolveImagePriceMultiplier({ frameCount: 2, outputFormat: 'gif' })).toBe(1);
+ });
+
+ it('counts a GIF without a frame count as one image', () => {
+ expect(resolveImagePriceMultiplier({ outputFormat: 'gif' })).toBe(1);
+ });
+});
+
+describe('resolveImageSinglePrice', () => {
+ it('returns the approximate price for static output', () => {
+ expect(resolveImageSinglePrice(tokenPricing)).toEqual({ approximatePrice: 0.035 });
+ });
+
+ it('raises the approximate price for multi-frame GIF output', () => {
+ const { approximatePrice } = resolveImageSinglePrice(tokenPricing, {
+ frameCount: 70,
+ outputFormat: 'gif',
+ });
+
+ expect(approximatePrice).toBeCloseTo(0.35);
+ });
+
+ it('keeps fixed per-image prices unchanged', () => {
+ const pricing: Pricing = {
+ units: [{ name: 'imageGeneration', rate: 0.04, strategy: 'fixed', unit: 'image' }],
+ };
+
+ expect(resolveImageSinglePrice(pricing, { frameCount: 70, outputFormat: 'gif' })).toEqual({
+ price: 0.04,
+ });
+ });
+});
diff --git a/packages/model-runtime/src/core/usageConverters/utils/resolveImageSinglePrice.ts b/packages/model-runtime/src/core/usageConverters/utils/resolveImageSinglePrice.ts
index 26cd77295db..9297127cec4 100644
--- a/packages/model-runtime/src/core/usageConverters/utils/resolveImageSinglePrice.ts
+++ b/packages/model-runtime/src/core/usageConverters/utils/resolveImageSinglePrice.ts
@@ -1,4 +1,4 @@
-import type { Pricing } from 'model-bank';
+import type { Pricing, RuntimeImageGenParams } from 'model-bank';
export interface ImageSinglePriceResult {
approximatePrice?: number;
@@ -7,12 +7,49 @@ export interface ImageSinglePriceResult {
const DEFAULT_REFERENCE_MP = (1024 * 1024) / 1_000_000;
-export const resolveImageSinglePrice = (pricing?: Pricing): ImageSinglePriceResult => {
+/**
+ * Frames whose combined output tokens roughly equal one static image at default settings.
+ *
+ * Measured on GPT Image 2.6 Flare (2026-11-05, default quality/size): a static image used 903
+ * output tokens, a 2-frame GIF 555 and a 9-frame GIF 1,172, i.e. roughly 380 + 88 × frames, though
+ * a later 4-frame GIF used 974. Scaling the static price by `frames / 7` (never below one image)
+ * is only an admission estimate: it can fall up to ~10% below the real cost around 6–9 frames and
+ * runs high for long GIFs (about 1.4× at 64 frames). The charge always settles to reported usage.
+ */
+const GIF_FRAMES_PER_IMAGE_PRICE = 7;
+
+/** Generation settings that affect the estimate; other params are accepted and ignored. */
+export interface ImageSinglePriceParams {
+ [key: string]: unknown;
+ frameCount?: RuntimeImageGenParams['frameCount'];
+ outputFormat?: RuntimeImageGenParams['outputFormat'];
+}
+
+/**
+ * How many static-image prices one generation is estimated to cost: animated GIFs scale with
+ * their frame count, everything else counts as one image.
+ */
+export const resolveImagePriceMultiplier = (params?: ImageSinglePriceParams): number => {
+ if (params?.outputFormat !== 'gif' || typeof params.frameCount !== 'number') return 1;
+
+ return Math.max(1, params.frameCount / GIF_FRAMES_PER_IMAGE_PRICE);
+};
+
+/**
+ * Per-generation price of an image model. Pass the generation params to account for settings
+ * that change the cost of a token-billed model, such as animated GIF frames.
+ */
+export const resolveImageSinglePrice = (
+ pricing?: Pricing,
+ params?: ImageSinglePriceParams,
+): ImageSinglePriceResult => {
if (!pricing) return {};
// Priority 1: Use approximate price if explicitly provided
if (typeof pricing.approximatePricePerImage === 'number') {
- return { approximatePrice: pricing.approximatePricePerImage };
+ return {
+ approximatePrice: pricing.approximatePricePerImage * resolveImagePriceMultiplier(params),
+ };
}
// Priority 2: Calculate exact price from pricing units
diff --git a/packages/model-runtime/src/providers/azureOpenai/index.test.ts b/packages/model-runtime/src/providers/azureOpenai/index.test.ts
index 670561a846f..5af6a99cc2a 100644
--- a/packages/model-runtime/src/providers/azureOpenai/index.test.ts
+++ b/packages/model-runtime/src/providers/azureOpenai/index.test.ts
@@ -826,6 +826,21 @@ describe('LobeAzureOpenAI', () => {
expect(arg).toHaveProperty('image');
});
+ it('should send GIF output fields and keep the GIF MIME type', async () => {
+ const generateSpy = vi
+ .spyOn(instance['client'].images, 'generate')
+ .mockResolvedValue({ data: [{ b64_json: 'R0lGODlh' }], output_format: 'gif' } as any);
+
+ const res = await instance.createImage({
+ model: 'gpt-image-2.6-flare',
+ params: { frameCount: 4, frameDurationMs: 300, outputFormat: 'gif', prompt: 'gif' },
+ });
+
+ const arg = vi.mocked(generateSpy).mock.calls[0][0] as any;
+ expect(arg).toMatchObject({ frame_count: 4, frame_duration_ms: 300, output_format: 'gif' });
+ expect(res).toEqual({ imageUrl: 'data:image/gif;base64,R0lGODlh' });
+ });
+
it('should not include image in generate options', async () => {
const generateSpy = vi
.spyOn(instance['client'].images, 'generate')
diff --git a/packages/model-runtime/src/providers/azureOpenai/index.ts b/packages/model-runtime/src/providers/azureOpenai/index.ts
index 182be3224e2..af0ddf2386a 100644
--- a/packages/model-runtime/src/providers/azureOpenai/index.ts
+++ b/packages/model-runtime/src/providers/azureOpenai/index.ts
@@ -5,6 +5,10 @@ import { AzureOpenAI } from 'openai';
import { pruneReasoningPayload } from '../../core/contextBuilders/openai';
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
+import {
+ applyImageOutputParams,
+ resolveImageOutputMimeType,
+} from '../../core/openaiCompatibleFactory/imageOutputParams';
import { refineErrorCode } from '../../errors';
import type {
ASROptions,
@@ -303,6 +307,8 @@ export class LobeAzureOpenAI extends BaseAzureOpenAI {
if (userInput.size === 'auto') delete userInput.size;
+ applyImageOutputParams(userInput, { isImageEdit });
+
// gpt-image-2 rejects input_fidelity because it is always high fidelity by default.
// Keep the parameter limited to the gpt-image-1 family, matching OpenAI-compatible runtime.
const shouldUseInputFidelity = isImageEdit && supportsImageInputFidelity(model);
@@ -343,7 +349,11 @@ export class LobeAzureOpenAI extends BaseAzureOpenAI {
}
if (imageData.b64_json) {
- return { imageUrl: `data:image/png;base64,${imageData.b64_json}` };
+ const mimeType = resolveImageOutputMimeType(
+ result.output_format,
+ azureImageOptions.output_format,
+ );
+ return { imageUrl: `data:${mimeType};base64,${imageData.b64_json}` };
}
if (imageData.url) {
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/FrameCountSliderInput.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/FrameCountSliderInput.tsx
new file mode 100644
index 00000000000..8053a6e78b7
--- /dev/null
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/FrameCountSliderInput.tsx
@@ -0,0 +1,11 @@
+import { SliderWithInput } from '@lobehub/ui';
+import { memo } from 'react';
+
+import { useGenerationConfigParam } from '@/store/image/slices/generationConfig/hooks';
+
+const FrameCountSliderInput = memo(() => {
+ const { value, setValue, min, max, step } = useGenerationConfigParam('frameCount');
+ return <SliderWithInput max={max} min={min} step={step} value={value} onChange={setValue} />;
+});
+
+export default FrameCountSliderInput;
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/FrameDurationSliderInput.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/FrameDurationSliderInput.tsx
new file mode 100644
index 00000000000..d3428d9f7f5
--- /dev/null
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/FrameDurationSliderInput.tsx
@@ -0,0 +1,11 @@
+import { SliderWithInput } from '@lobehub/ui';
+import { memo } from 'react';
+
+import { useGenerationConfigParam } from '@/store/image/slices/generationConfig/hooks';
+
+const FrameDurationSliderInput = memo(() => {
+ const { value, setValue, min, max, step } = useGenerationConfigParam('frameDurationMs');
+ return <SliderWithInput max={max} min={min} step={step} value={value} onChange={setValue} />;
+});
+
+export default FrameDurationSliderInput;
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/OutputFormatSelect.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/OutputFormatSelect.tsx
new file mode 100644
index 00000000000..f22f13d5a63
--- /dev/null
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/OutputFormatSelect.tsx
@@ -0,0 +1,38 @@
+import { Select } from '@lobehub/ui';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { useGenerationConfigParam } from '@/store/image/slices/generationConfig/hooks';
+
+const LABELED_FORMATS = new Set(['gif', 'png']);
+
+interface OutputFormatSelectProps {
+ /**
+ * Disable the animated option. GIF output is generation-only, so it is unavailable while
+ * reference images are attached.
+ */
+ disableAnimated?: boolean;
+}
+
+const OutputFormatSelect = memo<OutputFormatSelectProps>(({ disableAnimated }) => {
+ const { t } = useTranslation('image');
+ const { value, setValue, enumValues } = useGenerationConfigParam('outputFormat');
+
+ const options =
+ enumValues?.map((format) => {
+ const disabled = format === 'gif' && disableAnimated;
+ const label = LABELED_FORMATS.has(format)
+ ? t(`config.outputFormat.options.${format as 'gif' | 'png'}`)
+ : format.toUpperCase();
+
+ return {
+ disabled,
+ label: disabled ? `${label} · ${t('config.outputFormat.gifRefUnsupported')}` : label,
+ value: format,
+ };
+ }) ?? [];
+
+ return <Select options={options} style={{ width: '100%' }} value={value} onChange={setValue} />;
+});
+
+export default OutputFormatSelect;
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/index.ts b/src/routes/(main)/(create)/image/features/ConfigPanel/index.ts
index 31eaa37e082..0888e510e19 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/index.ts
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/index.ts
@@ -1,9 +1,12 @@
export { default as AspectRatioSelect } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/AspectRatioSelect';
export { default as CfgSliderInput } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/CfgSliderInput';
export { default as DimensionControlGroup } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/DimensionControlGroup';
+export { default as FrameCountSliderInput } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/FrameCountSliderInput';
+export { default as FrameDurationSliderInput } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/FrameDurationSliderInput';
export { default as ImageNum } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/ImageNum';
export { default as ImageUpload } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload';
export { default as ImageModelItem } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/ModelSelect/ImageModelItem';
+export { default as OutputFormatSelect } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/OutputFormatSelect';
export { default as QualitySelect } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/QualitySelect';
export { default as ResolutionSelect } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/ResolutionSelect';
export { default as SeedNumberInput } from '@/routes/(main)/(create)/image/features/ConfigPanel/components/SeedNumberInput';
diff --git a/src/routes/(main)/(create)/image/features/PromptInput/index.tsx b/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
index 083caadfc92..e46d325a873 100644
--- a/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
+++ b/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
@@ -27,7 +27,10 @@ import {
import {
CfgSliderInput,
DimensionControlGroup,
+ FrameCountSliderInput,
+ FrameDurationSliderInput,
ImageNum,
+ OutputFormatSelect,
QualitySelect,
ResolutionSelect,
SeedNumberInput,
@@ -177,6 +180,10 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {
const isSupportPromptExtend = useImageStore(isSupportedParamSelector('promptExtend'));
const isSupportWatermark = useImageStore(isSupportedParamSelector('watermark'));
const isSupportWebSearch = useImageStore(isSupportedParamSelector('webSearch'));
+ const isSupportOutputFormat = useImageStore(isSupportedParamSelector('outputFormat'));
+ const isSupportFrameCount = useImageStore(isSupportedParamSelector('frameCount'));
+ const isSupportFrameDurationMs = useImageStore(isSupportedParamSelector('frameDurationMs'));
+ const isAnimatedOutput = useImageStore(imageGenerationConfigSelectors.isAnimatedOutput);
const isLogin = useUserStore(authSelectors.isLogin);
const enabledImageModelList = useAiInfraStore(aiProviderSelectors.enabledImageModelList);
const isModelConfigReady = useAiInfraStore((s) =>
@@ -269,6 +276,7 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {
createImage,
]);
+ // `canDropImage` is false while GIF output is selected (see `useImageReferenceUpload`).
const showInlineRef = canDropImage;
const hasRefImages = imagePreviewUrls.length > 0;
const displayVisibility = activeGenerationTopic
@@ -350,6 +358,27 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {
<QualitySelect />
</Flexbox>
)}
+ {isSupportOutputFormat && (
+ <Flexbox gap={6}>
+ <Text fontSize={12}>{t('config.outputFormat.label')}</Text>
+ <OutputFormatSelect
+ // In-flight uploads count too: they land as references after finishing.
+ disableAnimated={hasRefImages || uploadingPreviews.length > 0}
+ />
+ </Flexbox>
+ )}
+ {isAnimatedOutput && isSupportFrameCount && (
+ <Flexbox gap={6}>
+ <Text fontSize={12}>{t('config.frameCount.label')}</Text>
+ <FrameCountSliderInput />
+ </Flexbox>
+ )}
+ {isAnimatedOutput && isSupportFrameDurationMs && (
+ <Flexbox gap={6}>
+ <Text fontSize={12}>{t('config.frameDurationMs.label')}</Text>
+ <FrameDurationSliderInput />
+ </Flexbox>
+ )}
{isSupportResolution && (
<Flexbox gap={6}>
<Text fontSize={12}>{t('config.resolution.label')}</Text>
diff --git a/src/routes/(main)/(create)/image/features/PromptInput/useImageReferenceUpload.ts b/src/routes/(main)/(create)/image/features/PromptInput/useImageReferenceUpload.ts
index e9812446dd7..52889afaa75 100644
--- a/src/routes/(main)/(create)/image/features/PromptInput/useImageReferenceUpload.ts
+++ b/src/routes/(main)/(create)/image/features/PromptInput/useImageReferenceUpload.ts
@@ -31,6 +31,10 @@ export const useImageReferenceUpload = () => {
const isSupportImageUrl = useImageStore(isSupportedParamSelector('imageUrl'));
const isSupportImageUrls = useImageStore(isSupportedParamSelector('imageUrls'));
+ // GIF output and reference images exclude each other; block new references while GIF is
+ // selected, but keep removal available.
+ const isAnimatedOutput = useImageStore(imageGenerationConfigSelectors.isAnimatedOutput);
+ const canAddReference = canCreate && !isAnimatedOutput;
const {
value: imageUrl,
@@ -96,7 +100,7 @@ export const useImageReferenceUpload = () => {
const { canDropImage, handleUploadFiles, imagePreviewUrls, maxCount, maxFileSize } =
useReferenceImageUpload({
addUploadingPreviews: addUploadingImagePreviews,
- canCreate,
+ canCreate: canAddReference,
maxFileSize: imageUrlsMaxFileSize ?? imageUrlMaxFileSize,
onFirstDimensions: autoSetDimensions,
onLimitExceeded,
@@ -107,7 +111,7 @@ export const useImageReferenceUpload = () => {
const handleAddImage = useCallback(
(data: UploadData) => {
- if (!canCreate) return;
+ if (!canAddReference) return;
const { url, dimensions } = extractUrlAndDimensions(data);
if (!url) return;
@@ -133,7 +137,7 @@ export const useImageReferenceUpload = () => {
setImageUrls,
autoSetDimensions,
extractUrlAndDimensions,
- canCreate,
+ canAddReference,
],
);
diff --git a/src/store/image/slices/generationConfig/selectors.test.ts b/src/store/image/slices/generationConfig/selectors.test.ts
index 30f2bfebb49..2059e410f28 100644
--- a/src/store/image/slices/generationConfig/selectors.test.ts
+++ b/src/store/image/slices/generationConfig/selectors.test.ts
@@ -207,4 +207,31 @@ describe('imageGenerationConfigSelectors', () => {
);
});
});
+
+ describe('isAnimatedOutput', () => {
+ const gifSchema: ModelParamsSchema = {
+ outputFormat: { default: 'png', enum: ['png', 'gif'] },
+ prompt: { default: '' },
+ };
+
+ it('is true only when the model declares outputFormat and GIF is selected', () => {
+ const gif = merge(initialStore, {
+ parameters: { outputFormat: 'gif', prompt: '' },
+ parametersSchema: gifSchema,
+ });
+ const png = merge(initialStore, {
+ parameters: { outputFormat: 'png', prompt: '' },
+ parametersSchema: gifSchema,
+ });
+
+ expect(imageGenerationConfigSelectors.isAnimatedOutput(gif)).toBe(true);
+ expect(imageGenerationConfigSelectors.isAnimatedOutput(png)).toBe(false);
+ });
+
+ it('ignores a stale GIF value on a model without outputFormat', () => {
+ const state = merge(initialStore, { parameters: { outputFormat: 'gif', prompt: '' } });
+
+ expect(imageGenerationConfigSelectors.isAnimatedOutput(state)).toBe(false);
+ });
+ });
});
diff --git a/src/store/image/slices/generationConfig/selectors.ts b/src/store/image/slices/generationConfig/selectors.ts
index 227bc8fdd1a..311a9237178 100644
--- a/src/store/image/slices/generationConfig/selectors.ts
+++ b/src/store/image/slices/generationConfig/selectors.ts
@@ -16,10 +16,18 @@ const isSupportedParam = (paramName: RuntimeImageGenParamsKeys) => {
};
};
+/**
+ * Whether the current model will produce an animated GIF. GIF output is generation-only (the
+ * OpenAI edit endpoint rejects it), so it excludes reference images.
+ */
+const isAnimatedOutput = (s: GenerationConfigState) =>
+ isSupportedParam('outputFormat')(s) && s.parameters?.outputFormat === 'gif';
+
export const imageGenerationConfigSelectors = {
model,
provider,
imageNum,
+ isAnimatedOutput,
isSupportedParam,
parameters,
parametersSchema,