Edit Image banner
disler disler

Edit Image

Development community intermediate

Description

This command edits existing images based on provided edit prompts using Replicate's API directly via curl.

Installation

Terminal
claude install-skill https://github.com/disler/agentic-drop-zones

README


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

    undefined

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// - 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

    undefined
- 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: ```bash 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//edit_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//_edited_.jpg "OUTPUT_URL"` - Display: - Source image path - Edit prompt used - Generation time (if available in response)