Grok Imagine Image logo

Grok Imagine Image

Community
wwwzhouhui
grok-imagine-image

使用 grok-imagine-image 模型,通过兼容 Grok2API / OpenAI 风格的接口(`/v1/images/generations`)生成图片。当用户要求用 Grok Imagine / grok-imagine-image 生成、绘制、创作图片时使用;或其他工作流需要本地脚本调用该生图模型时使用。当用户明确指定 Grok Imagine,或提供该 Grok2API 地址时,优先使用本技能,而不是通用生图工具。

Overview

Publisherwwwzhouhui
Repositoryskills_collection
Skill namegrok-imagine-image
Stars
285
Forks
57
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wwwzhouhui on GitHub. Read the source before you install it.

Installation

Install the Grok Imagine Image AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wwwzhouhui/skills_collection/tree/main/grok-imagine-image
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wwwzhouhui/skills_collection.git /tmp/skills_collection
mkdir -p .claude/skills
cp -r /tmp/skills_collection/grok-imagine-image .claude/skills/grok-imagine-image
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Grok Imagine Image in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Grok Imagine Image on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Grok Imagine Image is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Grok Imagine 生图

通过 POST /v1/images/generations 调用 grok-imagine-image 生成图片。

快速开始

在任意工作区执行:

bash
python "$CODEX_HOME/skills/grok-imagine-image/scripts/generate.py" \
  --prompt "a cozy reading nook with soft daylight" \
  --output-dir ./outputs \
  --name-tag reading-nook \
  --json

Windows 绝对路径示例:

bash
python "C:\Users\Administrator\.codex\skills\grok-imagine-image\scripts\generate.py" \
  --prompt "a simple red apple on a white background" \
  --output-dir "./outputs" \
  --json

默认配置

项目默认值
API 地址http://43.163.230.83:8000/v1
模型grok-imagine-image
尺寸1024x1024
超时180 秒
API Key写在 scripts/generate.py 中的占位符(DEFAULT_API_KEY)

可用环境变量或参数覆盖:

  • GROK_IMAGINE_API_KEY / --api-key
  • GROK_IMAGINE_API_BASE / --api-base
  • GROK_IMAGINE_MODEL / --model

工作流程

  1. 确认用户需要使用 Grok Imagine 生图。
  2. 写清楚提示词(该接口通常英文 prompt 效果更稳)。
  3. 选择当前工作区下的输出目录(面向用户的图片优先放 outputs/)。
  4. 运行 scripts/generate.py。
  5. 回报本地保存路径和可访问的图片 URL。
  6. 若下载成功,把本地图片路径展示给用户。

重要接口行为

  • 只使用 /v1/images/generations。不要用 /v1/chat/completions 调 grok-imagine-image。
  • 成功响应大致如下:
json
{
  "created": 1785029720,
  "data": [
    {
      "mime_type": "image/jpeg",
      "revised_prompt": "",
      "url": "http://127.0.0.1:8000/v1/media/images/img_xxx"
    }
  ]
}
  • 返回的媒体 URL 可能指向 127.0.0.1。脚本会在下载前改写为配置的公网主机地址。
  • 生图可能需要几十秒;超时时间请保持较高(默认 180 秒)。

脚本参数

bash
python scripts/generate.py \
  --prompt "..." \
  --prompt-file ./prompt.txt \
  --output-dir ./outputs \
  --name-tag my-image \
  --n 1 \
  --size 1024x1024 \
  --model grok-imagine-image \
  --api-base http://43.163.230.83:8000/v1 \
  --api-key g2a_xxx \
  --timeout 180 \
  --json

常用参数:

  • --json:输出机器可读 JSON,方便 Agent 解析
  • --no-download:只打印 API URL,不下载文件
  • --response-format url|b64_json:可选 OpenAI 风格字段(若网关支持)

密钥配置

首次正式使用前,请替换:

scripts/generate.py 中的 DEFAULT_API_KEY = "g2a_REPLACE_ME"

或设置:

bash
# PowerShell
$env:GROK_IMAGINE_API_KEY = "g2a_xxx"
$env:GROK_IMAGINE_API_BASE = "http://43.163.230.83:8000/v1"

不要在用户可见回复中完整打印 API Key。

失败处理

  • invalid_request / 缺少 model 或 prompt:检查请求体,确保 --prompt 非空。
  • 401/403:密钥缺失、仍是占位符,或未授权。
  • 超时:用相同 prompt 重试一次;生图本身可能较慢。
  • 生成成功但下载失败:回报改写后的公网 URL,并保留生成结果。
  • 若走 Chat Completions 失败:改回 images/generations。

Agent 检查清单

  • 优先使用本技能自带脚本,不要手写临时 curl/Python。
  • 用户可见图片优先保存到工作区 outputs/。
  • 成功后简要汇报:使用的 prompt、本地路径、公网 URL。
  • 若用户提供了新的 base URL 或 key,优先用参数/环境变量传入,不要去改无关文件。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Grok Imagine Image AI skill do?

使用 grok-imagine-image 模型,通过兼容 Grok2API / OpenAI 风格的接口(`/v1/images/generations`)生成图片。当用户要求用 Grok Imagine / grok-imagine-image 生成、绘制、创作图片时使用;或其他工作流需要本地脚本调用该生图模型时使用。当用户明确指定 Grok Imagine,或提供该 Grok2API 地址时,优先使用本技能,而不是通用生图工具。

Why use Grok Imagine Image on TypingMind?

Because you install it once and use it with any model. Grok Imagine Image is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Grok Imagine Image in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wwwzhouhui/skills_collection/tree/main/grok-imagine-image. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Grok Imagine Image?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Grok Imagine Image?

As many as you like. As long as a model supports skills, you can use Grok Imagine Image with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Grok Imagine Image AI skill free?

It is published on GitHub by wwwzhouhui. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇