agentleFS
alphaqiualphaqiu/bifang-skills/skills/text-to-image/SKILL.md

text-to-image

Skill0 starsChanged 7 months agoMITView on GitHub

Generates images from text descriptions using the Token Plan text-to-image model. Use this skill when asked to "draw a picture," "generate an image," or "create an image based on a description," such as "生成一张图片" or "根据描述创建图像" or "draw a cat wearing a hat" or "generate a night view of a futuristic city." Accepts plain text prompts and outputs images.

  • Reads credentials
  • Sends data out

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. meitu/meitu-skills★ 33same name
    2. 0gfoundation/0g-agent-skills★ 15same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Step-0: Check that the environment variable $TOKEN_PLAN_API_KEY exists.

    line 20
  2. Very specific:

    If code is not null, stop and tell the user the error with message.

    line 41
  3. Very specific:

    If images has entries, download them one by one to the current directory.

    line 42
  4. Distinctive:

    If the user has explicitly specified a save path, save there instead.

    line 43
  5. Very specific:

    When the user provides an aspect ratio, convert it to the corresponding size.

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Generate an image by calling the Token Plan text-to-image API based on the text description.

Execution Steps

Step-0: Check that the environment variable $TOKEN_PLAN_API_KEY exists. Keep it secret. If not set, stop and prompt the user to configure it.

Step-1: Extract parameters from user input:

  • prompt (required): The image description.
  • model (optional, default: qwen-image-2.0-pro): See Available Models.
  • size (optional, default: 2688*1152): Image dimensions in WIDTH*HEIGHT format. See Available Sizes.
  • asratio (optional): Aspect ratio like 16:9, 9:16, 1:1. If provided, convert to size using the Aspect Ratio table. Takes precedence over size.

Step-2: Execute the curl command to generate the image:

RESPONSE=$(curl -s -X POST "https://token-plan.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation" \
  -H "Authorization: Bearer $TOKEN_PLAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<model>","input":{"messages":[{"role":"user","content":[{"text":"<prompt>"}]}]},"parameters":{"size":"<size>"}}')
echo "$RESPONSE"|jq -r '{code, message, images: [.output.choices[]?.message.content[]?.image]}'

Step-3: Extract the jq result — code is the error code, message is the error description, images is a list of image URLs from output.choices[*].message.content[*].image.

  • If code is not null, stop and tell the user the error with message.
  • If images has entries, download them one by one to the current directory.
  • If the user has explicitly specified a save path, save there instead.

Result Example

Successful response

{
  "code": null,
  "message": null,
  "images": [
    "https://dashscope-7c2c.oss-accelerate.aliyuncs.com/..."
  ]
}

Failed response — invalid parameter

{
  "code": "InvalidParameter",
  "message": "Image area must be between 262144 (512x512) and 4194304 (2048x2048) pixels.",
  "images": []
}

Step-4: Return the file path(s) of the downloaded image(s).

Aspect Ratio

When the user provides an aspect ratio, convert it to the corresponding size. asratio takes precedence over size — if both are given, use the ratio.

Aspect RatioSizeBest For
2.35:12688*1152Ultrawide cinematic (default)
1:11024*1024Square format
1:1:high2048*2048High-resolution square
16:92688*1536Landscape / widescreen
9:161536*2688Mobile / vertical
4:32368*1728Standard landscape
3:41728*2368Standard portrait
21:92368*1024Ultrawide banner

Available Sizes

Can also be specified directly in WIDTH*HEIGHT format:

1024*1024, 720*1280, 1280*720, 2048*2048, 2688*1536, 1536*2688, 2368*1728, 1728*2368, 2368*1024, 2688*1152

Available Models

ModelDescription
qwen-image-2.0General-purpose, versatile, proficient in Chinese text rendering
qwen-image-2.0-proHigher quality (default)
wan2.7-imageMultiple styles, defaults to 4 images
wan2.7-image-proSupports 4K resolution

Prompt Writing Tips

The qwen-image models handle detailed prompts well. For best results:

  • Be specific about subjects: describe the main subject clearly — appearance, pose, expression, clothing.
  • Describe the scene: background, lighting, weather, time of day, camera angle.
  • Specify the art style: photorealistic, oil painting, watercolor, anime, pixel art, 3D render, etc.
  • Mention color palette: e.g., "暖色调" (warm tones), "冷色调蓝紫色" (cool blue-purple tones).
  • Include composition hints: close-up, wide shot, bird's-eye view, centered, rule of thirds.
  • State the mood: dreamy, dramatic, serene, vibrant, moody.

A good image prompt is typically 50-200 words, rich in visual detail.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.