# AI Image Editor — Transform Photos with Text Prompts (`akash9078/ai-image-editor`) Actor

AI-powered image-to-image editing using text prompts. Transform photos, product images, and artwork with natural language instructions.

- **URL**: https://apify.com/akash9078/ai-image-editor.md
- **Developed by:** [Akash Kumar Naik](https://apify.com/akash9078) (community)
- **Categories:** AI, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## AI Image Editor

AI-powered image editing using text prompts. Transform photos, product images, and artwork with natural language instructions.

### What it does

This actor edits images based on a text prompt using the RunPod `qwen-image-edit-2511-lora` endpoint. Upload an image, describe the changes you want, and receive an edited version.

- 🖼️ Edit any image via URL using AI-powered image-to-image transformation
- 📝 Natural language prompts — describe what you want changed
- ⚡ Synchronous execution — waits for the result and returns it
- 🎨 Supports JPEG, PNG, and WebP output formats
- 🔧 Optional LoRA adapters and advanced parameters

### Input

```json
{
    "imageUrl": "https://example.com/photo.jpg",
    "prompt": "A futuristic city with glowing neon lights",
    "outputFormat": "jpeg",
    "aspectRatio": "1024*1024",
    "seed": -1
}
````

#### Input fields

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `imageUrl` | string | ✅ | URL of the image to edit |
| `prompt` | string | ✅ | Text description of the desired edit |
| `outputFormat` | string | ❌ | Output format: `jpeg`, `png`, `webp` (default: `jpeg`) |
| `aspectRatio` | string | ❌ | Output dimensions: `1024*1024`, `1024*1280`, `1280*1024`, `1280*1280`, `1280*1536`, `1536*1080` (default: `1024*1024`) |
| `seed` | integer | ❌ | Random seed for reproducibility. `-1` = random (default: `-1`) |
| `numInferenceSteps` | integer | ❌ | Number of denoising steps (1–100) |
| `guidance` | number | ❌ | Guidance scale for prompt adherence (1–20) |
| `enableBase64Output` | boolean | ❌ | Return image as base64 in response (default: `false`) |

### Output

The actor produces two outputs:

#### 📊 Dataset — Run Results

Metadata about the editing job, including a public URL to the edited image:

```json
{
    "status": "COMPLETED",
    "prompt": "A futuristic city with glowing neon lights",
    "originalImageUrl": "https://example.com/photo.jpg",
    "outputFormat": "jpeg",
    "imageSize": 245760,
    "imageExtension": "jpg",
    "contentType": "image/jpeg",
    "publicImageUrl": "https://api.apify.com/v2/key-value-stores/xxx/records/edited-image",
    "delayTime": 1500,
    "executionTime": 8200,
    "runpodJobId": "abc-123"
}
```

#### 🖼️ Key-Value Store — Edited Image

The generated/edited image is saved as `edited-image` in the default key-value store. It is accessible via a public URL that is returned in the dataset results.

### Use Cases

- 👗 Fashion & e-commerce — change backgrounds, lighting, or styles on product photos
- 🏠 Real estate — enhance property images, change time of day, add furnishings
- 🎨 Creative workflows — iterate on concept art and illustrations
- 📸 Photography — apply stylistic edits, lighting corrections, or scene modifications
- 🛍️ Marketing — quickly generate variations of campaign imagery

### Tips & Best Practices

- **Be specific in prompts** — detailed descriptions yield better edits
- **Use seeds** — set a fixed seed to reproduce the same edit style across multiple images
- **Start with defaults** — the default `1024*1024` size and format work well for most cases
- **Check RunPod dashboard** — if jobs fail, verify your API key and endpoint availability
- **Timeout** — the actor waits up to 5 minutes for RunPod to complete the job

# Actor input Schema

## `imageUrl` (type: `string`):

URL of the image to edit. Supports direct image URLs and public Google Drive links.

## `prompt` (type: `string`):

Text prompt describing the desired image edit

## `outputFormat` (type: `string`):

Format of the output image

## `aspectRatio` (type: `string`):

Dimensions of the output image

## `seed` (type: `integer`):

Random seed for reproducibility. Use -1 for random.

## `numInferenceSteps` (type: `integer`):

Number of denoising steps. Higher = better quality but slower.

## `guidance` (type: `number`):

How closely to follow the prompt. Higher = stricter adherence.

## `enableBase64Output` (type: `boolean`):

Return image as base64 string in the response

## Actor input object example

```json
{
  "imageUrl": "https://drive.google.com/file/d/1S5sCnyVmnRHxk233EfZ6byjClr8pxaUU/view?usp=drive_link",
  "prompt": "Professional product photography of a young white female model wearing/holding the provided [PRODUCT], 9:16 vertical Pinterest aspect ratio, front-facing portrait with direct confident eye contact, natural soft studio lighting with large softbox and fill reflector, high-resolution 8K commercial quality, minimalist aesthetic with product clearly showcased as hero element, choose from backgrounds: prefer natural landscape.",
  "outputFormat": "jpeg",
  "aspectRatio": "1024*1024",
  "seed": -1,
  "numInferenceSteps": 28,
  "guidance": 7.5,
  "enableBase64Output": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Metadata including the public image URL

## `outputUrl` (type: `string`):

Public URL to download the edited image directly

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrl": "https://drive.google.com/file/d/1S5sCnyVmnRHxk233EfZ6byjClr8pxaUU/view?usp=drive_link",
    "prompt": "Professional product photography of a young white female model wearing/holding the provided [PRODUCT], 9:16 vertical Pinterest aspect ratio, front-facing portrait with direct confident eye contact, natural soft studio lighting with large softbox and fill reflector, high-resolution 8K commercial quality, minimalist aesthetic with product clearly showcased as hero element, choose from backgrounds: prefer natural landscape.",
    "outputFormat": "jpeg",
    "aspectRatio": "1024*1024",
    "seed": -1,
    "numInferenceSteps": 28,
    "guidance": 7.5,
    "enableBase64Output": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("akash9078/ai-image-editor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "imageUrl": "https://drive.google.com/file/d/1S5sCnyVmnRHxk233EfZ6byjClr8pxaUU/view?usp=drive_link",
    "prompt": "Professional product photography of a young white female model wearing/holding the provided [PRODUCT], 9:16 vertical Pinterest aspect ratio, front-facing portrait with direct confident eye contact, natural soft studio lighting with large softbox and fill reflector, high-resolution 8K commercial quality, minimalist aesthetic with product clearly showcased as hero element, choose from backgrounds: prefer natural landscape.",
    "outputFormat": "jpeg",
    "aspectRatio": "1024*1024",
    "seed": -1,
    "numInferenceSteps": 28,
    "guidance": 7.5,
    "enableBase64Output": False,
}

# Run the Actor and wait for it to finish
run = client.actor("akash9078/ai-image-editor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrl": "https://drive.google.com/file/d/1S5sCnyVmnRHxk233EfZ6byjClr8pxaUU/view?usp=drive_link",
  "prompt": "Professional product photography of a young white female model wearing/holding the provided [PRODUCT], 9:16 vertical Pinterest aspect ratio, front-facing portrait with direct confident eye contact, natural soft studio lighting with large softbox and fill reflector, high-resolution 8K commercial quality, minimalist aesthetic with product clearly showcased as hero element, choose from backgrounds: prefer natural landscape.",
  "outputFormat": "jpeg",
  "aspectRatio": "1024*1024",
  "seed": -1,
  "numInferenceSteps": 28,
  "guidance": 7.5,
  "enableBase64Output": false
}' |
apify call akash9078/ai-image-editor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=akash9078/ai-image-editor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AI Image Editor — Transform Photos with Text Prompts",
        "description": "AI-powered image-to-image editing using text prompts. Transform photos, product images, and artwork with natural language instructions.",
        "version": "0.1",
        "x-build-id": "d8ox9kwm1L5BFZjm2"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/akash9078~ai-image-editor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-akash9078-ai-image-editor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/akash9078~ai-image-editor/runs": {
            "post": {
                "operationId": "runs-sync-akash9078-ai-image-editor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/akash9078~ai-image-editor/run-sync": {
            "post": {
                "operationId": "run-sync-akash9078-ai-image-editor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "imageUrl",
                    "prompt"
                ],
                "properties": {
                    "imageUrl": {
                        "title": "Source Image URL",
                        "pattern": "^https?://.+",
                        "type": "string",
                        "description": "URL of the image to edit. Supports direct image URLs and public Google Drive links.",
                        "default": "https://drive.google.com/file/d/1S5sCnyVmnRHxk233EfZ6byjClr8pxaUU/view?usp=drive_link"
                    },
                    "prompt": {
                        "title": "Edit Prompt",
                        "type": "string",
                        "description": "Text prompt describing the desired image edit"
                    },
                    "outputFormat": {
                        "title": "Output Format",
                        "enum": [
                            "jpeg",
                            "png",
                            "webp"
                        ],
                        "type": "string",
                        "description": "Format of the output image",
                        "default": "jpeg"
                    },
                    "aspectRatio": {
                        "title": "Aspect Ratio",
                        "enum": [
                            "1024*1024",
                            "1024*1280",
                            "1280*1024",
                            "1280*1280",
                            "1280*1536",
                            "1536*1080"
                        ],
                        "type": "string",
                        "description": "Dimensions of the output image",
                        "default": "1024*1024"
                    },
                    "seed": {
                        "title": "Random Seed",
                        "type": "integer",
                        "description": "Random seed for reproducibility. Use -1 for random.",
                        "default": -1
                    },
                    "numInferenceSteps": {
                        "title": "Number of Inference Steps",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of denoising steps. Higher = better quality but slower."
                    },
                    "guidance": {
                        "title": "Guidance Scale",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "number",
                        "description": "How closely to follow the prompt. Higher = stricter adherence."
                    },
                    "enableBase64Output": {
                        "title": "Enable Base64 Output",
                        "type": "boolean",
                        "description": "Return image as base64 string in the response",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
