Skip to main content
With the Decart API, you can transform and edit existing images using text prompts. Simply upload an image and describe the changes you want to make, and Lucy-Edit will intelligently modify your image while preserving important details. Lucy-Edit excels at style transfers, object modifications, background replacements, and artistic transformations. Our models maintain the core structure of your original image while applying your desired edits with high precision.

Quick start

Here’s a simple example using Lucy-Edit, our advanced image editing model.
curl -X POST https://api.decart.ai/v1/generate/lucy-pro-i2i \
  -H "X-API-KEY: $DECART_API_KEY" \
  -F "data=@input-image.jpg" \
  -F "prompt=Change the sky to sunset colors" \
  -F "resolution=720p" \
  --output edited-image.jpg

Parameters

  • data (required) — Input image file to edit.
  • prompt (required) — Text description of the changes to apply.
  • resolution (optional) — Output size: 480p or 720p (default: 720p).
For complete API documentation including response formats and error codes, see the API Reference.

Available Models and Options

Decart provides different editing models to balance precision, creativity, and cost depending on your use case. We currently offer:
  • LucyEdit — our flagship editing model for precise, high-quality image transformations.
  • LucyEdit-Dev (Coming Soon) — a faster model optimized for simple edits and quick iterations.
Supported resolutions:
  • 720p (720×1280) — detailed, higher quality, ideal for professional edits.
  • 480p (480×832) — faster, cheaper, well-suited for previews or smaller outputs.

Prompt Engineering for Edits

Image editing requires different prompt strategies than generation. Your prompts should clearly describe what to change while implicitly indicating what to preserve. LucyEdit interprets your instructions in the context of the existing image. Effective editing prompts are specific about changes (what to modify), clear about scope (local vs global edits), and descriptive about the target result. Unlike generation, you don’t need to describe the entire scene—focus only on what needs to change. LucyEdit excels at identity conservation, edit precision, realism, and prompt adherence. Pro tip: Longer, detailed prompts (20–30 words) describing style, appearance, and context produce significantly better results than short instructions.

Supported Edit Types

✅ Best Performance

1. Clothing Changes

LucyEdit excels at swapping outfits while preserving motion, pose, and identity. This is where the model truly shines.
  • Example: “Change the shirt to a kimono with wide sleeves and patterned fabric”
  • Example: “Replace the dress with a business suit, navy blue with pinstripes and a silk tie”

2. Human/Character Replacement

Strong results when transforming people into new characters or creatures. Detailed prompts are key for maintaining pose and composition.
  • Example: “Replace the person with a tiger, striped orange fur, muscular build, and glowing green eyes”
  • Example: “Replace the person with a 2D anime character, big eyes, blue gown and battle scars”

3. Object Replacement

Reliable for structure-preserving swaps. Ideal when replacing one object with another of similar scale.
  • Example: “Replace the apple with a glowing crystal ball emitting blue light”
  • Example: “Replace the car with a vintage motorcycle, chrome details and leather seat”

⚠️ Mixed Reliability

4. Color Changes

Sometimes subtle, sometimes exaggerated. Works best with precise descriptions of material and finish.
  • Example: “Change the jacket color to deep red leather with a glossy finish”
  • Tip: Specify the exact shade and material properties for better control

5. Adding Objects

Often attaches to the subject rather than appearing independently. Works best for wearable or handheld props.
  • Example: “Add a golden crown on the person’s head, decorated with ornate jewels”
  • Example: “Add sunglasses, aviator style with reflective lenses”

6. Global Transformations

Effective for backgrounds or scene-wide changes, but might alter the subject’s identity. Use carefully when subject preservation is important.
  • Example: “Transform the sunny beach into a snowy tundra with falling snowflakes”
  • Warning: May change the identity or appearance of people in the image

Additional Optimization Tips

  • Frame count matters: For video editing, 81-frame generations produce better temporal consistency than shorter clips
  • Detail improves results: Include style, materials, colors, and textures in your prompts
  • Be explicit about preservation: If certain elements must remain unchanged, consider mentioning what to keep
Bottom line: LucyEdit performs best with detailed prompts that clearly describe the desired changes. Focus on clothing swaps, character replacements, and object substitutions for the most reliable results. Be cautious with global transformations if preserving subject identity is crucial.

Endpoint and Full API Reference

Next steps

Now that you know the basics of image editing, you might want to check out one of these resources next.
I