Turn a one-sentence prompt into a 2K HD image: under the hood it calls the Gitee AI Serverless API's
z-image-turbo model (8-step ultra-fast generation), with about 100 free images per day, requiring only a
free token. It does not depend on any paid service.
Visual web version:freeimg.shenzjd.com —— If you don't want to write prompts, just use the web version: built-in 18,000+ curated prompt library、12 preset styles(official account cover / Xiaohongshu cover / knowledge card / poster / 3D cartoon / Chinese style, etc.), 7 size ratios, history, and image hosting upload. The Skill is responsible for letting the AI generate images directly in the conversation, while the web version is responsible for manual fine-tuning and browsing the prompt library; both share the same token.
When to Use
- User asks to generate / draw / create an image (icon, cover, illustration, poster, avatar)
- User mentions text-to-image / draw an image / generate an image / AI art / generate an avatar / generate a cover
- User wants quick AI images without paid API keys (z-image-turbo is free)
When NOT to Use:
- User wants to edit an existing image (this skill is text-to-image only) — for image reference/image-to-image use the
freeimg-hunyuanskill - User explicitly needs the Hunyuan model or the WeChat Mini Program Growth Plan free quota — use the
freeimg-hunyuanskill - User explicitly needs another model (DALL·E, Midjourney, Flux…) — use the corresponding skill/API
- No network access or Gitee AI is unreachable
Core Pattern
Step 0: First use — configure the free token
Token acquisition (free, three steps, see the freeimg.shenzjd.com page tutorial): Log in to ai.gitee.com/serverless-api → On any model details page, click "Online Experience" → "API" → "Add Token" → copy.
The script reads the token in the following priority order (Do not write the token into the repository, logs, or conversation output):
- Environment variable
GITEE_AI_API_KEY - Local configuration file
~/.freeimg-z-image/config.env(content one line:GITEE_AI_API_KEY=xxxx)
If neither is present, the script will print the above acquisition guide and exit; the AI should guide the user through Step 0,
and write the token into ~/.freeimg-z-image/config.env(chmod 600). Only once.
Step 1: Generate the image
scripts/generate.mjs --prompt "提示词" --out 输出.png \
[--width 1024] [--height 1024] [--steps 8] [--negative "负向提示词"]
--width/--height: must be a multiple of 8; see Quick Reference for common combinations--steps: default 8 (recommended value for the turbo model; higher is slower)--negative: defaults to文字,字母,水印,签名,模糊- when not passed. The interface occasionally returns 502; the script has built-in 2 backoff retries; if it still fails, try again at another time
Step 2: Delivery
- After generation, first view the image (Read tool) to confirm quality, then hand it to the user; if unsatisfied, change the prompt and regenerate. Do not give junk images to the userfirst view the image(Read tool) to confirm quality, then hand it to the user; if unsatisfied, change the prompt and regenerate. Do not give junk images to the user
- When you need a small size (such as an App avatar 144×144), use
sips -Z 144 原图 --out 小图.png(macOS) or ImageMagickconvert -resizeto resize - Prompts can be in Chinese; the model understands Chinese well; structure:
风格 + 主体 + 细节 + 构图 + 无文字无水印
Quick Reference
| Requirements | Parameters | Purpose |
|---|---|---|
| 1:1 square image | --width 1024 --height 1024(use 2048×2048 for HD) |
Avatars, icons, knowledge cards |
| 4:3 landscape image | --width 2048 --height 1536 |
Official account cover (900×383 can be cropped later) |
| 3:4 portrait image | --width 1536 --height 2048 |
Xiaohongshu cover |
| 16:9 wide image | --width 2048 --height 1152 |
PPT illustrations, banner |
Prompt template:
{风格,如 扁平卡通插画/3D 渲染/水彩}:{主体与细节},{构图,如 居中特写、四周留裁剪余量},{用途,如 App 图标、缩小时仍清晰},无文字,无水印
Environment variables:GITEE_AI_API_KEY(token),FREEIMG_Z_IMAGE_CONFIG(custom configuration file path).
Common Mistakes
- Commit the token into the repository: the token is equivalent to the free-quota account; only put it in
~/.freeimg-z-image/config.envor an environment variable;.envfiles are always.gitignore - Size is not a multiple of 8: For example, 1000×1000 will be rejected by the API or silently rounded; use 1024/1536/2048
- Garbled text in the image: z-image is unstable at rendering text; when text is needed, add it afterward with a design tool, and state "no text" in the prompt
- Delivering without checking after generation: The model occasionally produces deformed hands or off-center compositions; you must Read to inspect before giving it to the user
- Still retrying after the quota is exhausted: About 100 free generations per day; when a 429/403 is returned, tell the user to try again tomorrow or switch tokens