Text-to-image and image-to-image via any OpenAI-compatible image API.
Usage
/genimg <prompt> # text-to-image
/genimg <image_path> <prompt> # image-to-image
/genimg init # interactive setup wizard
Setup
If ~/.genimg/config.json doesn't exist, the script will print a friendly error with the expected format and suggest running /genimg init.
/genimg init — Interactive Setup
When the user runs /genimg init, walk them through creating or updating ~/.genimg/config.json:
- Ask for provider name (e.g. "volcengine", "openai", "together")
- Ask for base URL (the OpenAI-compatible API endpoint, e.g.
https://ark.cn-beijing.volces.com/api/v3) - Ask for API key
- Ask for model name (e.g.
doubao-seedream-3-0-t2i-250415,dall-e-3) - Ask for default size (e.g.
2048x2048,1024x1024) - Write config to
~/.genimg/config.json, setting this asdefault_provider
If a config already exists, show current providers and offer to add a new one or update an existing one.
Config
Provider settings live in ~/.genimg/config.json. Structure:
{
"providers": {
"<name>": {
"base_url": "...",
"api_key": "...",
"model": "...",
"default_size": "2048x2048"
}
},
"default_provider": "<name>"
}
default_size must be valid for the configured provider and model. Do not assume 1024x1024 is universally accepted. For the current volcengine configuration, use 2048x2048.
To add a new provider, just add an entry to providers. To switch default, change default_provider.
Running
python3 <skill-path>/scripts/generate.py \
--prompt "<prompt>" \
--output "<output_path>" \
[--provider "<provider_name>"] \
[--image "<input_image_path>"] \
[--size "2048x2048"]
--provider: optional, defaults todefault_providerin config--image: enables img2img mode, size defaults toauto--size: override the provider's default size
Workflow
- Run
scripts/generate.pywith prompt and output path - Pick a short descriptive filename (English, kebab-case)
- Show the result to the user with the Read tool