Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
fix: default OpenAI image model to gpt-image-2
Alex Castillo38fe63dc7cc6
diff --git a/apps/daemon/src/codex/local-provider.ts b/apps/daemon/src/codex/local-provider.tsindex cd7599be..5d1f2013 100644--- a/apps/daemon/src/codex/local-provider.ts+++ b/apps/daemon/src/codex/local-provider.ts@@ -116,7 +116,7 @@ async function readJson(path: string, strict = false): Promise<Record<string, un}function imageModel(textModel: string): string {- return /^gpt-image-/i.test(textModel) ? textModel : 'gpt-image-1';+ return /^gpt-image-/i.test(textModel) ? textModel : 'gpt-image-2';}function readRecord(value: unknown): Record<string, TomlValue> | undefined {diff --git a/apps/daemon/src/image-generation/provider.ts b/apps/daemon/src/image-generation/provider.tsindex 4ad73f24..b92a52b1 100644--- a/apps/daemon/src/image-generation/provider.ts+++ b/apps/daemon/src/image-generation/provider.ts@@ -223,7 +223,7 @@ async function generateOpenAiImages(?? (request.provider === 'jimeng' ? config.image.jimeng : config.image.openai);if (!provider.apiKey.trim()) missingConfig(request.provider);const model = provider.model.trim()- || (request.provider === 'jimeng' ? 'doubao-seedream-4-0-250828' : 'gpt-image-1');+ || (request.provider === 'jimeng' ? 'doubao-seedream-4-0-250828' : 'gpt-image-2');const parameters = official ? undefined : manualImageParameters(request, request.provider === 'codex-native' ? 'openai' : request.provider, model);const endpoint = openAiImageEndpoint(provider.baseUrl,diff --git a/apps/daemon/test/integration/creator-image-generation.test.ts b/apps/daemon/test/integration/creator-image-generation.test.tsindex b67b08c3..363990a2 100644--- a/apps/daemon/test/integration/creator-image-generation.test.ts+++ b/apps/daemon/test/integration/creator-image-generation.test.ts@@ -259,7 +259,7 @@ describe('creator image generation', () => {status: 'completed',metadata: {provider: 'openai',- model: 'gpt-image-1',+ model: 'gpt-image-2',imageSize: '1536x1024',quality: 'high',resultVersion: 1diff --git a/apps/daemon/test/integration/image-generation-api.test.ts b/apps/daemon/test/integration/image-generation-api.test.tsindex acc8837d..fdeff672 100644--- a/apps/daemon/test/integration/image-generation-api.test.ts+++ b/apps/daemon/test/integration/image-generation-api.test.ts@@ -133,7 +133,7 @@ describe('image generation API', () => {expect(generated.statusCode).toBe(201);expect(generated.json().result).toMatchObject({id: 'image_result_1234',- model: 'gpt-image-1',+ model: 'gpt-image-2',imageSize: '1024x1024',quality: 'high',count: 1,@@ -141,7 +141,7 @@ describe('image generation API', () => {});expect(String(fetchImpl.mock.calls[0]?.[0])).toBe('https://images.example.test/v1/images/generations');expect(JSON.parse(String(fetchImpl.mock.calls[0]?.[1]?.body))).toMatchObject({- model: 'gpt-image-1',+ model: 'gpt-image-2',prompt: 'A quiet studio portrait',size: '1024x1024',quality: 'high',diff --git a/apps/daemon/test/unit/codex-local-provider.test.ts b/apps/daemon/test/unit/codex-local-provider.test.tsindex 674654e4..f5070b08 100644--- a/apps/daemon/test/unit/codex-local-provider.test.ts+++ b/apps/daemon/test/unit/codex-local-provider.test.ts@@ -29,7 +29,7 @@ describe('local Codex provider', () => {root = await codexHome(['openai_base_url = "https://api.example.test/v1"']);await writeFile(join(root, 'auth.json'), JSON.stringify({ auth_mode: 'apikey', OPENAI_API_KEY: 'api-secret' }));await expect(readLocalCodexImageConfiguration({ codexHome: root })).resolves.toMatchObject({- authentication: 'api_key', provider: { apiKey: 'api-secret', model: 'gpt-image-1' }+ authentication: 'api_key', provider: { apiKey: 'api-secret', model: 'gpt-image-2' }});});@@ -72,7 +72,7 @@ describe('local Codex provider', () => {await expect(readLocalCodexProvider({ codexHome: root })).resolves.toEqual({baseUrl: 'https://forward.example.test/v1',apiKey: 'gateway-secret',- model: 'gpt-image-1'+ model: 'gpt-image-2'});});@@ -109,7 +109,7 @@ describe('local Codex provider', () => {await expect(readLocalCodexProvider({ codexHome: root })).resolves.toEqual({baseUrl: 'https://api.example.test/v1',apiKey: 'stored-secret',- model: 'gpt-image-1'+ model: 'gpt-image-2'});});diff --git a/apps/web/src/features/dashboard/ImageGenerationWorkspace.test.tsx b/apps/web/src/features/dashboard/ImageGenerationWorkspace.test.tsxindex a9f3ac84..7548449d 100644--- a/apps/web/src/features/dashboard/ImageGenerationWorkspace.test.tsx+++ b/apps/web/src/features/dashboard/ImageGenerationWorkspace.test.tsx@@ -58,7 +58,7 @@ describe('ImageGenerationWorkspace', () => {fireEvent.click(screen.getByRole('combobox', { name: '模型' }));fireEvent.click(screen.getByRole('option', { name: 'GPT Image' }));expect(screen.getByRole('combobox', { name: '图片画幅' })).toHaveValue('1:1');- expect(screen.queryByRole('combobox', { name: '分辨率' })).not.toBeInTheDocument();+ expect(screen.getByRole('combobox', { name: '分辨率' })).toHaveValue('1K');expect(screen.getByRole('combobox', { name: '图片质量' })).toHaveValue('medium');});diff --git a/apps/web/src/features/settings/CreatorServicesSettingsView.test.tsx b/apps/web/src/features/settings/CreatorServicesSettingsView.test.tsxindex 35892fae..fb9cfefc 100644--- a/apps/web/src/features/settings/CreatorServicesSettingsView.test.tsx+++ b/apps/web/src/features/settings/CreatorServicesSettingsView.test.tsx@@ -496,7 +496,7 @@ describe('CreatorServicesSettingsView', () => {expect(screen.queryByLabelText('模型')).not.toBeInTheDocument();await user.click(screen.getByRole('combobox', { name: '服务商' }));await user.click(screen.getByRole('option', { name: 'GPT Image' }));- expect(screen.getByLabelText('模型')).toHaveValue('gpt-image-1');+ expect(screen.getByLabelText('模型')).toHaveValue('gpt-image-2');await user.click(screen.getByRole('combobox', { name: '服务商' }));await user.click(screen.getByRole('option', { name: '可灵' }));expect(screen.getByLabelText('Access Key')).toHaveAttribute('type', 'password');diff --git a/apps/web/src/features/settings/CreatorServicesSettingsView.tsx b/apps/web/src/features/settings/CreatorServicesSettingsView.tsxindex 20c149f6..92ee1999 100644--- a/apps/web/src/features/settings/CreatorServicesSettingsView.tsx+++ b/apps/web/src/features/settings/CreatorServicesSettingsView.tsx@@ -1067,7 +1067,7 @@ function ImageSettings(props: SettingsGroupProps & {<CodexImageStatusNotice service={props.service} enabled={props.enabled} /></Suspense>) : null}- {provider === 'openai' ? <OpenAiFields id="image-openai" credential="image.openai.apiKey" configuredCredentials={props.configuredCredentials} value={props.config.image.openai} modelPlaceholder="gpt-image-1" modelSuggestions={creatorProviderOfKind('image', 'openai')?.models.map(model => model.id)} onChange={value => props.update(config => { config.image.openai = value; })} /> : null}+ {provider === 'openai' ? <OpenAiFields id="image-openai" credential="image.openai.apiKey" configuredCredentials={props.configuredCredentials} value={props.config.image.openai} modelPlaceholder="gpt-image-2" modelSuggestions={creatorProviderOfKind('image', 'openai')?.models.map(model => model.id)} onChange={value => props.update(config => { config.image.openai = value; })} /> : null}{provider === 'jimeng' ? <OpenAiFields id="image-jimeng" credential="image.jimeng.apiKey" configuredCredentials={props.configuredCredentials} value={props.config.image.jimeng} modelPlaceholder="doubao-seedream-4-0-250828" modelSuggestions={creatorProviderOfKind('image', 'jimeng')?.models.map(model => model.id)} baseUrlPlaceholder="https://ark.cn-beijing.volces.com/api/v3" onChange={value => props.update(config => { config.image.jimeng = value; })} /> : null}{provider === 'kling' ? <KlingFields id="image-kling" accessKeyCredential="image.kling.accessKey" secretKeyCredential="image.kling.secretKey" configuredCredentials={props.configuredCredentials} value={props.config.image.kling} modelPlaceholder="kling-v2-1" modelSuggestions={creatorProviderOfKind('image', 'kling')?.models.map(model => model.id)} onChange={value => props.update(config => { config.image.kling = value; })} /> : null}{provider === 'gemini' ? <OpenAiFields id="image-gemini" credential="image.gemini.apiKey" configuredCredentials={props.configuredCredentials} value={props.config.image.gemini} modelPlaceholder="gemini-2.5-flash-image" modelSuggestions={creatorProviderOfKind('image', 'gemini')?.models.map(model => model.id)} baseUrlPlaceholder="https://generativelanguage.googleapis.com/v1beta" onChange={value => props.update(config => { config.image.gemini = value; })} /> : null}diff --git a/docs/development/codex-image-generation.md b/docs/development/codex-image-generation.mdindex 3642451a..785f3019 100644--- a/docs/development/codex-image-generation.md+++ b/docs/development/codex-image-generation.md@@ -5,7 +5,7 @@## API Key 模式- 保留现有配置的 Base URL、API Key 和图片模型,调用 `/images/generations` 或带参考图的 `/images/edits`。-- 文本模型不是图片模型时,保持原有 `gpt-image-1` 默认值。+- 文本模型不是图片模型时,使用默认值 `gpt-image-2`。- 接口必须支持图片生成。设置状态检查只检查本地配置,不会发送收费的生成请求。## ChatGPT 登录模式diff --git a/packages/protocol/src/creator-provider-catalog.ts b/packages/protocol/src/creator-provider-catalog.tsindex bd8d6529..1497abf6 100644--- a/packages/protocol/src/creator-provider-catalog.ts+++ b/packages/protocol/src/creator-provider-catalog.ts@@ -29,7 +29,7 @@ export const creatorProviderCatalog = [entry({ id: 'deepseek', kind: 'llm', label: 'DeepSeek', protocol: 'openai-compatible', defaultBaseUrl: 'https://api.deepseek.com', models: [{ id: 'deepseek-v4-pro', label: 'DeepSeek V4 Pro', recommended: true }, { id: 'deepseek-v4-flash', label: 'DeepSeek V4 Flash' }, { id: 'deepseek-flash', label: 'DeepSeek Flash' }], credentials: ['apiKey'], status: 'supported' }),entry({ id: 'minimax', kind: 'llm', label: 'MiniMax', protocol: 'openai-compatible', defaultBaseUrl: 'https://api.minimax.io', models: [{ id: 'MiniMax-M2.7', label: 'MiniMax M2.7', recommended: true }, { id: 'MiniMax-M2.7-highspeed', label: 'MiniMax M2.7 Highspeed' }, { id: 'MiniMax-M2.5', label: 'MiniMax M2.5' }, { id: 'MiniMax-M2.5-highspeed', label: 'MiniMax M2.5 Highspeed' }], credentials: ['apiKey'], status: 'supported' }),entry({ id: 'custom', kind: 'llm', label: 'Custom OpenAI-compatible', protocol: 'custom', models: [], credentials: ['apiKey'], status: 'supported' }),- entry({ id: 'openai', kind: 'image', label: 'OpenAI', protocol: 'openai-compatible', defaultBaseUrl: 'https://api.openai.com/v1', models: [{ id: 'gpt-image-1', label: 'GPT Image', recommended: true }], credentials: ['apiKey'], capabilities: ['text-to-image', 'image-edit', 'reference-image'], status: 'supported' }),+ entry({ id: 'openai', kind: 'image', label: 'OpenAI', protocol: 'openai-compatible', defaultBaseUrl: 'https://api.openai.com/v1', models: [{ id: 'gpt-image-2', label: 'GPT Image', recommended: true }], credentials: ['apiKey'], capabilities: ['text-to-image', 'image-edit', 'reference-image'], status: 'supported' }),entry({ id: 'jimeng', kind: 'image', label: 'Jimeng / Seedream', protocol: 'openai-compatible', defaultBaseUrl: 'https://ark.cn-beijing.volces.com/api/v3', models: [{ id: 'doubao-seedream-4-0-250828', label: 'Seedream 4.0', recommended: true }], credentials: ['apiKey'], capabilities: ['text-to-image'], status: 'supported' }),entry({ id: 'kling', kind: 'image', label: 'Kling', protocol: 'kling', defaultBaseUrl: 'https://api-beijing.klingai.com', models: [{ id: 'kling-v2-1', label: 'Kling v2.1', recommended: true }], credentials: ['accessKey', 'secretKey'], capabilities: ['text-to-image'], status: 'supported' }),entry({ id: 'gemini', kind: 'image', label: 'Nano Banana / Gemini', protocol: 'gemini', defaultBaseUrl: 'https://generativelanguage.googleapis.com/v1beta', models: [{ id: 'gemini-2.5-flash-image', label: 'Nano Banana', recommended: true }], credentials: ['apiKey'], capabilities: ['text-to-image', 'reference-image'], status: 'supported' }),diff --git a/packages/protocol/src/creator-services.ts b/packages/protocol/src/creator-services.tsindex 3753e931..010817f4 100644--- a/packages/protocol/src/creator-services.ts+++ b/packages/protocol/src/creator-services.ts@@ -332,7 +332,7 @@ export function createDefaultCreatorServicesConfig(): CreatorServicesConfig {openai: {baseUrl: '',apiKey: '',- model: 'gpt-image-1'+ model: 'gpt-image-2'},jimeng: {baseUrl: 'https://ark.cn-beijing.volces.com/api/v3',diff --git a/runtime/krillinai/config/config-example.toml b/runtime/krillinai/config/config-example.tomlindex c0fbb7c3..d775776f 100644--- a/runtime/krillinai/config/config-example.toml+++ b/runtime/krillinai/config/config-example.toml@@ -90,4 +90,4 @@[image.openai]base_url = "" # 生图接口base url,留空使用OpenAI官方接口;自定义转发站通常填写以/v1结尾的地址api_key = "" # 生图API密钥- model = "gpt-image-1" # 生图模型,例如gpt-image-1,或转发站支持的兼容模型+ model = "gpt-image-2" # 生图模型,例如gpt-image-2,或转发站支持的兼容模型diff --git a/runtime/krillinai/config/config.go b/runtime/krillinai/config/config.goindex 186e3727..14d300bd 100644--- a/runtime/krillinai/config/config.go+++ b/runtime/krillinai/config/config.go@@ -224,7 +224,7 @@ var Conf = Config{Image: Image{Provider: "openai-compatible",Openai: OpenaiCompatibleConfig{- Model: "gpt-image-1",+ Model: "gpt-image-2",},},}diff --git a/runtime/krillinai/config/config_test.go b/runtime/krillinai/config/config_test.goindex 40e1f59f..8a1dd16e 100644--- a/runtime/krillinai/config/config_test.go+++ b/runtime/krillinai/config/config_test.go@@ -6,8 +6,8 @@ func TestDefaultImageConfig(t *testing.T) {if Conf.Image.Provider != "openai-compatible" {t.Fatalf("Image.Provider = %q, want openai-compatible", Conf.Image.Provider)}- if Conf.Image.Openai.Model == "" {- t.Fatalf("Image.Openai.Model is empty")+ if Conf.Image.Openai.Model != "gpt-image-2" {+ t.Fatalf("Image.Openai.Model = %q, want gpt-image-2", Conf.Image.Openai.Model)}}