npx skills add ...
npx skills add bytedance/deer-flow --skill image-generation
Use this skill when the user requests to generate, create, imagine, or visualize images including characters, scenes, products, or any visual content. Supports structured prompts and reference images for guided generation.
npx skills add bytedance/deer-flow --skill image-generation
This skill generates high-quality images using structured prompts and a Python script. The workflow includes creating JSON-formatted prompts and executing image generation with optional reference images.
When a user requests image generation, identify:
/mnt/user-dataGenerate a structured JSON file in /mnt/user-data/workspace/ with naming pattern: {descriptive-name}.json
Call the Python script:
Parameters:
--prompt-file: Absolute path to JSON prompt file (required)--reference-images: Absolute paths to reference images (optional, space-separated)--output-file: Absolute path to output image file (required)--aspect-ratio: Aspect ratio of the generated image (optional, default: 16:9)[!NOTE] Do NOT read the python file, just call it with the parameters.
User request: "Create a Tokyo street style woman character in 1990s"
Create prompt file: /mnt/user-data/workspace/asian-woman.json
Execute generation:
With reference images:
Use different JSON schemas for different scenarios.
Character Design:
Scene Generation:
Product Visualization:
Read the following template file only when matching the user request.
After generation:
/mnt/user-data/outputs/For scenarios where visual accuracy is critical, use the image_search tool first to find reference images before generation.
Recommended scenarios for using image_search tool:
Example workflow:
image_search tool to find suitable reference images:
--reference-images parameter in the generation scriptThis approach significantly improves generation quality by providing the model with concrete visual guidance rather than relying solely on text descriptions.
This skill auto-selects the provider by environment variables (no CLI change):
GEMINI_API_KEY set → use Gemini (default, unchanged).MINIMAX_API_KEY set → use MiniMax (/v1/image_generation, model image-01).IMAGE_GENERATION_API_KEY set → use an OpenAI-compatible Images API.IMAGE_GENERATION_PROVIDER=gemini|minimax|openai.
openai-compatible is also accepted as an alias for openai.OpenAI-compatible settings:
IMAGE_GENERATION_API_KEY (required)IMAGE_GENERATION_BASE_URL (default https://api.openai.com/v1)IMAGE_GENERATION_MODEL (default gpt-image-2.5-flare)IMAGE_GENERATION_SIZE (optional fixed size override)Text-to-image calls use POST {base_url}/images/generations. Reference-image calls
use multipart POST {base_url}/images/edits; a relay may support generation without
supporting edits. Responses may contain base64 image data, a data URL, or a downloadable
URL. Aspect ratios map to 1024x1024, 1536x1024, or 1024x1536 unless
IMAGE_GENERATION_SIZE is set. The output extension selects the API output_format:
.jpg/.jpeg uses jpeg, .webp uses webp, and all other extensions use png.
When dall-e-2 or dall-e-3 is configured instead, the request uses the model's
supported dimensions and response_format=b64_json; DALL-E output files must use a
.png extension. Reference-image editing with DALL-E models is not supported by this
skill; use the default GPT Image model for edits.
MiniMax optional overrides: MINIMAX_API_HOST (default https://api.minimaxi.com),
MINIMAX_IMAGE_MODEL (default image-01). Reference images are sent as the MiniMax
subject_reference character image. The CLI and --prompt-file / --reference-images
/ --output-file / --aspect-ratio arguments are identical for both providers.
MiniMax prompt handling (provider-internal). Authoring is provider-agnostic — write
the same structured JSON regardless of which provider is active. MiniMax image-01
consumes a single text string, so the MiniMax path itself sends only the JSON prompt
field (the other fields such as style / composition / negative_prompt apply to the
Gemini path) and enables prompt_optimizer so MiniMax expands it server-side. MiniMax
caps that prompt at 1500 characters; if the prompt field is longer, the script returns
an error instead of calling the API. The Gemini path receives the full structured JSON.