Overview
AI Image Editor provides comprehensive image editing capabilities using AI. Modify, enhance, and transform images with text-based instructions for natural-looking results without manual editing tools.
How It Works
Upload image - Provide the image you want to edit
Describe changes - Use text to specify desired modifications
AI processes - AI applies edits intelligently
Download result - Retrieve your edited image
Use Cases
Photo editing - Quick modifications without manual tools
Object removal - Remove unwanted elements from images
Color adjustments - Change colors and tones
Style changes - Modify image aesthetics
Content addition - Add new elements to images
Best Practices
Editing Instructions
Be specific and clear - Detailed instructions produce more accurate edits.
Describe precisely - Specify exact changes wanted
One edit at a time - Better results with focused changes
Use descriptive language - Clear descriptions work best
Reference locations - Specify where changes should occur
Image Requirements
Requirement Details Resolution Minimum 512x512 pixels Format PNG, JPG, JPEG, WEBP Quality Higher quality enables better edits Clarity Clear images edit more accurately
Code Examples
Basic Image Edit
from magic_hour import Client
from os import getenv
client = Client( token = getenv( "API_TOKEN" ))
result = client.v1.ai_image_editor.generate(
assets = {
"image_file_path" : "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/tomcruise.png"
},
style = {
"prompt" : "Turn this image into studio ghibli style"
},
name = "Image Editor image" ,
wait_for_completion = True ,
download_outputs = True ,
download_directory = "outputs"
)
if result.status == "complete" :
print ( f "✅ Image edit complete!" )
print ( f "Downloaded to: { result.downloaded_paths } " )
print ( f "Credits charged: { result.credits_charged } " )
else :
print ( f "❌ Job failed with status: { result.status } " )
if hasattr (result, 'error_message' ):
print ( f "Error: { result.error_message } " )
Pricing
Output Credits 1 edited image 10 credits
API Reference
AI Image Editor API Reference View full API specification