From d6e43d5324b065d683e58bcb734b0bac02f6e458 Mon Sep 17 00:00:00 2001 From: shiyue <935732994@qq.com> Date: Thu, 5 Feb 2026 17:46:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=BA=20grok=20=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/settings.local.json | 12 ---- .kilocode/mcp.json | 14 ++++ .roo/mcp.json | 1 + config.json | 46 +++++++------ index.html | 43 +++++++----- script.js | 127 ++++++++++++++++++++++-------------- 6 files changed, 145 insertions(+), 98 deletions(-) delete mode 100644 .claude/settings.local.json create mode 100644 .kilocode/mcp.json create mode 100644 .roo/mcp.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 6719964..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(mkdir:*)" - ], - "deny": [] - }, - "env": { - "ANTHROPIC_AUTH_TOKEN": "sk-zpZrOa1KqxkLCBH0eMMiIxvyLONJ9SAglhktSGKNNjCuKQQn", - "ANTHROPIC_BASE_URL":"https://instcopilot-api.com" - } -} \ No newline at end of file diff --git a/.kilocode/mcp.json b/.kilocode/mcp.json new file mode 100644 index 0000000..4f09235 --- /dev/null +++ b/.kilocode/mcp.json @@ -0,0 +1,14 @@ +{ + "mcpServers": { + "superdesign": { + "command": "node", + "args": [ + "E:/我的项目/superdesign-mcp-claude-code/dist/index.js" + ], + "env": {}, + "alwaysAllow": [ + "superdesign_generate" + ] + } + } +} \ No newline at end of file diff --git a/.roo/mcp.json b/.roo/mcp.json new file mode 100644 index 0000000..6b0a486 --- /dev/null +++ b/.roo/mcp.json @@ -0,0 +1 @@ +{"mcpServers":{}} \ No newline at end of file diff --git a/config.json b/config.json index 1b5a386..d6489d6 100644 --- a/config.json +++ b/config.json @@ -1,23 +1,28 @@ { "app": { - "name": "OpenRouter Image Generator", - "version": "1.0.0", - "description": "基于OpenRouter API的图像生成Web应用", + "name": "Grok Image Generator", + "version": "2.0.0", + "description": "基于 Grok API 的图像生成 Web 应用", "author": "OVINC CN", "license": "MIT" }, "api": { - "default_base_url": "https://openrouter.ai/api/v1", + "default_base_url": "", "default_timeout": 600, - "default_model": "google/gemini-2.5-flash-image-preview:free", + "default_model": "grok-imagine-1.0", + "default_response_format": "b64_json", + "default_n": 1, "supported_models": [ { - "id": "google/gemini-2.5-flash-image-preview:free", - "name": "Google Gemini 2.5 Flash Image Preview", - "description": "免费的Google Gemini模型,支持图像生成和视觉理解", - "pricing": "free" + "id": "grok-imagine-1.0", + "name": "Grok Imagine 1.0", + "description": "Grok 图像生成模型,支持文本到图像生成", + "pricing": "paid", + "capabilities": ["text-to-image"] } - ] + ], + "supported_response_formats": ["url", "b64_json"], + "max_images_per_request": 10 }, "ui": { "theme": { @@ -42,22 +47,23 @@ } }, "storage": { - "settings_key": "openRouterSettings", - "chat_history_key": "openRouterChatHistory", - "generated_images_key": "openRouterGeneratedImages" + "settings_key": "grokImageSettings", + "chat_history_key": "grokImageChatHistory", + "generated_images_key": "grokGeneratedImages" }, "endpoints": { - "models": "/models", - "chat_completions": "/chat/completions", - "image_generation": "/images/generations" + "models": "/v1/models", + "image_generation": "/v1/images/generations" }, "error_messages": { - "no_api_key": "请先输入API Key", - "connection_failed": "连接失败,请检查网络和API设置", - "invalid_response": "API响应格式错误", + "no_api_key": "请先输入 API Key", + "no_base_url": "请先配置 API 地址", + "connection_failed": "连接失败,请检查网络和 API 设置", + "invalid_response": "API 响应格式错误", "image_generation_failed": "图像生成失败", "file_too_large": "文件大小超过限制", "unsupported_format": "不支持的文件格式", - "upload_failed": "文件上传失败" + "upload_failed": "文件上传失败", + "image_edit_not_supported": "当前 API 不支持图像编辑,仅支持文本生成图像" } } \ No newline at end of file diff --git a/index.html b/index.html index ce87810..be9f169 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@
-基于OpenRouter API的智能图像生成工具
+基于 Grok API 的智能图像生成工具
拖拽图像到此处或点击选择文件 (最多10张)
- -