agentleFS
nearthinknearthink/agent-skills/skills/image-generation/SKILL.md

image-generation

Skill0 starsChanged 7 months agoMITView on GitHub

Generate or edit images via NodeStudio API. Use when the user asks to create, generate, draw, illustrate an image (text-to-image), OR edit, modify, retouch, remove, erase, replace, fix, enhance, change elements in an existing image (image-to-image). Covers: 生成图片、画图、修图、编辑图片、抹除、去除、替换、美化、P图、图片处理。

63 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use gift-evaluator, Podcast Generate and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dav-niu474Skill

    gift-evaluator

    The PRIMARY tool for Spring Festival gift analysis and social interaction generation. Use this skill when users upload photos of gifts (alcohol, tea, supplements, etc.) to inquire about their value, authenticity, or how to respond socially. Integrates visual perception, market valuation, and HTML card generation.

    Also in 5 projects that use this

  • dav-niu474Skill

    Podcast Generate

    Generate podcast episodes from user-provided content or by searching the web for specified topics. If user uploads a text file/article, creates a dual-host dialogue podcast (or single-host upon request). If no content is provided, searches the web for information about the user-specified topic and generates a podcast. Duration scales with content size (3-20 minutes, ~240 chars/min). Uses z-ai-web-dev-sdk for LLM script generation and TTS audio synthesis. Outputs both a podcast script (Markdown) and a complete audio file (WAV).

    Also in 5 projects that use this

  • huang-x-hSkill

    Video Generation

    Implement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or images, create video content programmatically, or build applications that produce video outputs. Supports asynchronous task management with status polling and result retrieval.

    Also in 6 projects that use this

  • huang-x-hSkill

    VLM

    Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images, describe visual content, or create applications that combine image understanding with conversational AI. Supports image URLs and base64 encoded images for multimodal interactions.

    Also in 6 projects that use this

  • +1 more from huang-x-h
  • +7 more from dav-niu474

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 53 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Always: run poll_until_done.py <task_id> with exec timeout ≥ 300 unless step 1 already returned image_urls

    line 26
  2. Very specific:

    Default model: nano2. Fallback: nano-pro → seedream.

    line 54
  3. Very specific:

    Default 240s internal wait.

    line 109
  4. Very specific:

    No pre-read: Do not read_file SKILL.md / ls scripts/ / read_file download.py / models.py before first submit.

    line 139
  5. Very specific:

    No manual env: Do not read auth tokens, do not set NANOBOT_SESSION_KEY, do not mkdir.

    line 140
  6. Distinctive:

    JSON compact: No pretty-print, no trailing whitespace.

    line 142
  7. Distinctive:

    Model name in output: Use display_name only (Seedream V5.0 Lite / MiniDesk Pro / MiniDesk 2).

    line 143

“Common” is measured: kept by at least 6 in 10 of the 53 edited versions of this file we could read. “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

Image Generation

Tool budget

PathCallsSteps
Default4submit (timeout 90) → poll_until_done (timeout 300) → download → message
If submit returns image_urls3submit → download → message
Fallback after failed+2models.py → submit.py (new model)

Hard rule: DO NOT read_file / ls this skill directory. DO NOT run models.py before the first submit.py. All info needed to build JSON is in this file.

Default path

  1. submit.py '<compact_json>' with exec timeout ≥ 90 → returns task_id + possibly image_urls
  2. Always run poll_until_done.py <task_id> with exec timeout ≥ 300 unless step 1 already returned image_urls
  3. download.py '<image_url_or_json_array>' '<name>' — auto saves to workspace outputs
  4. One message(media) — done

Important: submit may take 30–90s even for "sync" models under load. Always set exec timeout high enough — never use default.

Silent policy

No user-visible status text until the final delivery. Only the final message() with media. Quota message is the single exception (exact string in Error table).

Model name rule: 对用户使用 API 的 display_name:Seedream V5.0 Lite / MiniDesk Pro / MiniDesk 2。

Token & URLs

  • Token: auto from ~/.deskclaw/deskclaw-settings.json → auth.token (优先) → authToken (回退), or env NODESTUDIO_TOKEN.
  • NodeStudio base: env NODESTUDIO_URL (default https://nostudio-api.deskclaw.me).
  • Scripts handle token + URL automatically, agent does not need to read config or pass token.

Models (no pre-flight models.sh)

Default priority(用户未指定模型时)

Prioritymodel_idDisplay NameTypeNotes
1nano2MiniDesk 2may sync0.5K–4K, 6 ref, ratios: 1:1 3:2 2:3 3:4 4:3 4:5 5:4 9:16 16:9 21:9 1:4 4:1 1:8 8:1, fastest
2nano-proMiniDesk Promay sync1K–4K, 6 ref, ratios: 1:1 3:2 2:3 3:4 4:3 4:5 5:4 9:16 16:9 21:9, 30-90s
3seedreamSeedream V5.0 Liteasync2K/3K, 14 ref, ratios: 21:9 16:9 3:2 4:3 1:1 3:4 2:3 9:16, up to 4 outputs, 60-180s

Default model: nano2. Fallback: nano-pro → seedream. Call models.py only when retrying after failed or user names a model you must validate.

Quality priority(用户要求"最好/最高质量"时)

Qualitymodel_idDisplay Name
1nano-proMiniDesk Pro
2nano2MiniDesk 2
3seedreamSeedream V5.0 Lite

当用户明确说"用最好的模型""质量最高""高清大图"等质量优先意图时,按此顺序选择。

Build JSON

Compact, no spaces after : or ,. Only include fields that differ from defaults.

Defaults (omit if unchanged): model=nano2, aspect_ratio=1:1, resolution=0.5K, image_count=1, save_to_assets=true.

IntentAdd field
Portrait"aspect_ratio":"9:16" (or 2:3 / 3:4)
Landscape"aspect_ratio":"16:9" (or 3:2 / 4:3 / 21:9)
Resolution"resolution":"3K" / "1K" / "0.5K" / "4K" (model-dependent)
Multiple images"image_count":2 (max 4)
Image-to-image"reference_images":["media/img.png"] (local paths auto-converted to base64 by script)
Specific model"model":"nano-pro"

Minimal example (most requests): {"prompt":"一只橘猫趴在窗台上晒太阳"}

High-quality example: {"prompt":"电商主图,护肤品","model":"nano-pro","aspect_ratio":"1:1","resolution":"2K","image_count":2}

Image-to-Image (reference_images)

reference_images accepts three formats — the script handles conversion automatically:

FormatExampleNotes
Public URL"https://cdn.example.com/photo.png"Must be direct link (no redirects)
Local path"media/img.png" or absolute pathAuto-converted to base64 data URI
data URI"data:image/png;base64,..."Passed through as-is
  • Local paths are resolved relative to workspace (~/.deskclaw/nanobot/workspace), or as absolute paths.
  • Files > 10MB are rejected with an error — ask user to resize.
  • Large images may cause submit to return 504 (gateway timeout). This is not a failure — the task is still processing. Run poll_until_done.py to get the result.
  • seedream model has strict content moderation for image-to-image; may return 400.

Commands (copy-paste, do not improvise)

Submit (exec timeout ≥ 90): python <skill_dir>/scripts/submit.py '<json>'

Poll (exec timeout ≥ 300; skip only if submit already returned image_urls): python <skill_dir>/scripts/poll_until_done.py <task_id> 240 Default 240s internal wait. progress:50 while processing is normal, not a stall.

Download (supports single URL or JSON array): python <skill_dir>/scripts/download.py '<url_or_array>' '<short_name>' Auto saves to $WORKSPACE/outputs/. Do NOT manually set NANOBOT_SESSION_KEY or read auth tokens — the script handles everything.

Present: Single message(media) with local path(s). Silent until this point.

Fallback (only on failed or content-flagged)

  1. models.py → pick next model per Default priority.
  2. Re-submit with new model. (+2 calls)

Error Handling

CaseAction
401/403Re-auth
400 (bad aspect/resolution)Pick a supported value from Models table
429 / quota创作点已用完,请前往 DeskClaw 充值后再试~
504 (submit)Not a failure — task is processing. Run poll_until_done.py normally
422 upstream_errorReference image URL unreachable or format unsupported. Use local path instead
File > 10MBScript rejects automatically. Ask user to resize the image
failedFallback above
Poll timeoutResume poll_until_done same task_id, different max_seconds

Rules

  • Scripts only: submit.py, poll_until_done.py, download.py, models.py (fallback only). No raw curl. Always use python, never bash.
  • No pre-read: Do not read_file SKILL.md / ls scripts/ / read_file download.py / models.py before first submit.
  • No manual env: Do not read auth tokens, do not set NANOBOT_SESSION_KEY, do not mkdir. Scripts handle auth + output dirs automatically.
  • No status text: No "正在生成…" / "请稍等" / progress updates. Silent until message(media).
  • JSON compact: No pretty-print, no trailing whitespace.
  • Model name in output: Use display_name only (Seedream V5.0 Lite / MiniDesk Pro / MiniDesk 2).

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.