Generate or edit images using AI (Gemini/OpenAI/xAI)
From claude-image-generationnpx claudepluginhub hex/claude-marketplace --plugin claude-image-generation<prompt> [--edit <image-path>]Generate or edit an image based on the user's request.
Parse the arguments:
--edit is present, the next argument is the path to an input image for editingAsk the user which provider to use with AskUserQuestion:
Ask the user where to save the output with AskUserQuestion:
./generated-image.png)Execute the generation using tasks for progress tracking:
If single provider selected: a. Create a task with TaskCreate:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/<provider>.sh" \
--mode <generate|edit> \
--prompt "<prompt>" \
--output "<output-path>" \
[--input-image "<input-path>"]
d. Mark the task completed (or note the error if it failed)
If multiple providers selected: a. Create a task per provider with TaskCreate:
source "${CLAUDE_PLUGIN_ROOT}/scripts/display.sh" && display_pane_open
This outputs a path like /tmp/display_pane.XXXXXX — capture it as DISPLAY_PANE_DIR.
d. Launch Task subagents in parallel (subagent_type: Bash), each running one script.
Use different output filenames (e.g., image-gemini.png, image-openai.png, image-xai.png).
Pass DISPLAY_PANE_DIR so images appear progressively in the shared pane:
DISPLAY_PANE_DIR=<captured-path> bash "${CLAUDE_PLUGIN_ROOT}/scripts/<provider>.sh" \
--mode <generate|edit> --prompt "<prompt>" --output "<output-path>"
e. As each subagent returns, mark its corresponding task completed (or note the error) f. After all providers complete, close the streaming pane to show interactive controls:
DISPLAY_PANE_DIR=<captured-path> bash -c \
'source "${CLAUDE_PLUGIN_ROOT}/scripts/display.sh" && display_pane_close'
After generation completes, confirm the output path(s) to the user. If multiple were generated, let the user know all files are available so they can compare.
GEMINI_API_KEY for Gemini providerOPENAI_API_KEY for OpenAI providerXAI_API_KEY or GROK_API_KEY for xAI provider