/edit_image
Edit existing images via Replicate using direct curl API calls
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/edit_image
Context preview
What this command does when you run it.
Edit existing images via Replicate using direct curl API calls
Command definition
edit_image.mdname: Edit Image
allowed-tools: Bash, Read
description: Edit existing images via Replicate using direct curl API calls
Edit Image
This command edits existing images based on provided edit prompts using Replicate's API directly via curl.
Prerequisites
- REPLICATE_API_TOKEN must be exported in the environment
- Requires base64 command for inline image encoding
Variables
DROPPED_FILE_PATH: [[FILE_PATH]] DROPPED_FILE_PATH_ARCHIVE: agentic_drop_zone/edit_images_zone/drop_zone_file_archive/ IMAGE_OUTPUT_DIR: agentic_drop_zone/edit_images_zone/image_output/<date_time>/
- This is the directory where all images will be saved
- The date_time is the current date and time in the format YYYY-MM-DD_HH-MM-SS
MODEL: google/nano-banana API_ENDPOINT: https://api.replicate.com/v1/models/google/nano-banana/predictions
Workflow
- Note: REPLICATE_API_TOKEN will be available, don't search for it and NEVER read the .env file directly.
- IMPORTANT: If for some reason you run into issues with authentication, abort immediately - do not continue with any image processing. Mention that the REPLICATE_API_TOKEN might be missing.
- First, read `DROPPED_FILE_PATH`.
- Create output directory: `IMAGE_OUTPUT_DIR/<date_time>/`
- IMPORTANT: For every image edit detailed in the `DROPPED_FILE_PATH` do the following:
<image-loop>
- Extract the source image path and edit prompt from the dropped file
- Use curl with inline base64 encoding to send image directly to Replicate API:
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d '{
"input": {
"prompt": "YOUR_EDIT_PROMPT_HERE",
"image_input": ["data:image/jpeg;base64,'$(base64 -i /path/to/source/image.jpg)'"],
"output_format": "jpg"
}
}' \
https://api.replicate.com/v1/models/google/nano-banana/predictions- IMPORTANT: Replace `YOUR_EDIT_PROMPT_HERE` with the actual edit instruction
- IMPORTANT: Replace `/path/to/source/image.jpg` with the actual source image path which should be detailed in the `DROPPED_FILE_PATH`
- IMPORTANT: The base64 encoding happens inline using `$(base64 -i /path/to/image.jpg)`
- Parse JSON response to extract the `output` URL field for the generated image
- Response format: `{"id":"...", "output":"https://replicate.delivery/...jpg", "status":"succeeded"}`
- Extract URL with `jq -r '.output'`
- Save the executed edit prompts to `IMAGE_OUTPUT_DIR/<date_time>/edit_prompt_<concise_name_based_on_prompt>.txt`
- Include both the source image path and the exact edit prompt that was executed
- Download the edited image from the output URL: `curl -o IMAGE_OUTPUT_DIR/<date_time>/<MODEL_NAME_underscore_separated>_edited_<concise_name_based_on_prompt>.jpg "OUTPUT_URL"`
- Display:
- Source image path
- Edit prompt used
- Generation time (if available in response)
- File size of downloaded image
- Full path to saved edited image
- Replicate output URL for reference
</image-loop>
- After all images are edited, copy all original source images to the output directory for reference:
- For each source image that was processed, copy it with "original_" prefix
- Example: `cp /path/to/cat.jpg IMAGE_OUTPUT_DIR/<date_time>/original_cat.jpg`
- This allows easy before/after comparison in the same directory
- After copying originals, open the output directory: `open IMAGE_OUTPUT_DIR/<date_time>/`
- When you finish editing images, move the `DROPPED_FILE_PATH` into a `DROPPED_FILE_PATH_ARCHIVE` directory
Example Usage
# The REPLICATE_API_TOKEN is sourced from the .env file
# Execute image edit with inline base64 encoding
RESPONSE=$(curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d '{
"input": {
"prompt": "Make the cat blue",
"image_input": ["data:image/jpeg;base64,'$(base64 -i ./source_image.jpg)'"],
"output_format": "jpg"
}
}' \
https://api.replicate.com/v1/models/google/nano-banana/predictions)
# Extract output URL and download
OUTPUT_URL=$(echo "$RESPONSE" | jq -r '.output')
curl -o edited_image.jpg "$OUTPUT_URL"Read more
name: Edit Image allowed-tools: Bash, Read description: Edit existing images via Replicate using direct curl API calls
Edit Image
This command edits existing images based on provided edit prompts using Replicate's API directly via curl.
Prerequisites
- REPLICATE_API_TOKEN must be exported in the environment
- Requires base64 command for inline image encoding
Variables
DROPPED_FILE_PATH: [[FILE_PATH]] DROPPED_FILE_PATH_ARCHIVE: agentic_drop_zone/edit_images_zone/drop_zone_file_archive/ IMAGE_OUTPUT_DIR: agentic_drop_zone/edit_images_zone/image_output/<date_time>/
- This is the directory where all images will be saved
- The date_time is the current date and time in the format YYYY-MM-DD_HH-MM-SS
MODEL: google/nano-banana API_ENDPOINT: https://api.replicate.com/v1/models/google/nano-banana/predictions
Workflow
- Note: REPLICATE_API_TOKEN will be available, don't search for it and NEVER read the .env file directly.
- IMPORTANT: If for some reason you run into issues with authentication, abort immediately - do not continue with any image processing. Mention that the REPLICATE_API_TOKEN might be missing.
- First, read `DROPPED_FILE_PATH`.
- Create output directory: `IMAGE_OUTPUT_DIR/<date_time>/`
- IMPORTANT: For every image edit detailed in the `DROPPED_FILE_PATH` do the following:
<image-loop>
- Extract the source image path and edit prompt from the dropped file
- Use curl with inline base64 encoding to send image directly to Replicate API:
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d '{
"input": {
"prompt": "YOUR_EDIT_PROMPT_HERE",
"image_input": ["data:image/jpeg;base64,'$(base64 -i /path/to/source/image.jpg)'"],
"output_format": "jpg"
}
}' \
https://api.replicate.com/v1/models/google/nano-banana/predictions- IMPORTANT: Replace `YOUR_EDIT_PROMPT_HERE` with the actual edit instruction
- IMPORTANT: Replace `/path/to/source/image.jpg` with the actual source image path which should be detailed in the `DROPPED_FILE_PATH`
- IMPORTANT: The base64 encoding happens inline using `$(base64 -i /path/to/image.jpg)`
- Parse JSON response to extract the `output` URL field for the generated image
- Response format: `{"id":"...", "output":"https://replicate.delivery/...jpg", "status":"succeeded"}`
- Extract URL with `jq -r '.output'`
- Save the executed edit prompts to `IMAGE_OUTPUT_DIR/<date_time>/edit_prompt_<concise_name_based_on_prompt>.txt`
- Include both the source image path and the exact edit prompt that was executed
- Download the edited image from the output URL: `curl -o IMAGE_OUTPUT_DIR/<date_time>/<MODEL_NAME_underscore_separated>_edited_<concise_name_based_on_prompt>.jpg "OUTPUT_URL"`
- Display:
- Source image path
- Edit prompt used
- Generation time (if available in response)
- File size of downloaded image
- Full path to saved edited image
- Replicate output URL for reference
</image-loop>
- After all images are edited, copy all original source images to the output directory for reference:
- For each source image that was processed, copy it with "original_" prefix
- Example: `cp /path/to/cat.jpg IMAGE_OUTPUT_DIR/<date_time>/original_cat.jpg`
- This allows easy before/after comparison in the same directory
- After copying originals, open the output directory: `open IMAGE_OUTPUT_DIR/<date_time>/`
- When you finish editing images, move the `DROPPED_FILE_PATH` into a `DROPPED_FILE_PATH_ARCHIVE` directory
Example Usage
# The REPLICATE_API_TOKEN is sourced from the .env file
# Execute image edit with inline base64 encoding
RESPONSE=$(curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d '{
"input": {
"prompt": "Make the cat blue",
"image_input": ["data:image/jpeg;base64,'$(base64 -i ./source_image.jpg)'"],
"output_format": "jpg"
}
}' \
https://api.replicate.com/v1/models/google/nano-banana/predictions)
# Extract output URL and download
OUTPUT_URL=$(echo "$RESPONSE" | jq -r '.output')
curl -o edited_image.jpg "$OUTPUT_URL"See what you can do with the Agentic Drop Zone in this video. Automated file processing system that monitors directories and triggers agents (Claude Code, Gemini CLI, Codex CLI) when files are dropped.
Repo: disler/agentic-drop-zones
Other commands on agentic-drop-zones.
- /create_image
Generate image(s) via Replicate
Open command - /echo
Echo the contents of the file at DROPPED_FILE_PATH and provide a brief summary.
Open command - /finance_categorizer
This command analyzes bank statement CSV files, corrects missing or incorrect categorizations, and generates comprehensive spending reports with visual indicators for high spending areas.
Open command - /more_training_data
Analyze data patterns and generate additional synthetic training data
Open command - /morning_debrief
Transcribe morning debrief audio and analyze for engineering ideas and priorities
Open command - /prime
Understand the files in the `Read` section, and execute the `Run` commands then `Report` your findings.
Open command

