Skip to content

Commit 2a7ad0a

Browse files
docs: add meta/muse-image-edit (#507)
1 parent 6c78ebe commit 2a7ad0a

4 files changed

Lines changed: 305 additions & 1 deletion

File tree

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@
444444
* [Luma Uni-1 Max](api-references/image-models/Luma-AI/uni-1-max.md)
445445
* [meta](api-references/image-models/meta/README.md)
446446
* [Meta Muse Image](api-references/image-models/meta/muse-image.md)
447+
* [Meta Muse Image Edit](api-references/image-models/meta/muse-image-edit.md)
447448
* [OpenAI](api-references/image-models/OpenAI/README.md)
448449
* [DALL·E 2](api-references/image-models/OpenAI/dall-e-2.md)
449450
* [DALL·E 3](api-references/image-models/OpenAI/dall-e-3.md)
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "AIML API",
5+
"version": "1.0.0"
6+
},
7+
"servers": [
8+
{
9+
"url": "https://api.aimlapi.com"
10+
}
11+
],
12+
"paths": {
13+
"/v1/images/generations": {
14+
"post": {
15+
"operationId": "_v1_images_generations",
16+
"requestBody": {
17+
"required": true,
18+
"content": {
19+
"application/json": {
20+
"schema": {
21+
"type": "object",
22+
"properties": {
23+
"model": {
24+
"type": "string",
25+
"enum": [
26+
"meta/muse-image-edit"
27+
]
28+
},
29+
"prompt": {
30+
"type": "string",
31+
"description": "The text prompt describing the content, style, or composition of the image to be generated."
32+
},
33+
"image_urls": {
34+
"type": "array",
35+
"items": {
36+
"type": "string",
37+
"format": "uri"
38+
},
39+
"minItems": 1,
40+
"maxItems": 10,
41+
"description": "List of URLs or local Base64 encoded images to edit."
42+
},
43+
"num_images": {
44+
"type": "number",
45+
"minimum": 1,
46+
"maximum": 10,
47+
"default": 1,
48+
"description": "The number of images to generate."
49+
},
50+
"aspect_ratio": {
51+
"type": "string",
52+
"enum": [
53+
"21:9",
54+
"16:9",
55+
"4:3",
56+
"3:2",
57+
"1:1",
58+
"2:3",
59+
"3:4",
60+
"9:16",
61+
"9:21"
62+
],
63+
"description": "The aspect ratio of the edited image. If omitted, the aspect ratio of the last provided reference image is used."
64+
},
65+
"output_format": {
66+
"type": "string",
67+
"enum": [
68+
"jpeg",
69+
"png",
70+
"webp"
71+
],
72+
"default": "webp",
73+
"description": "The format of the generated image."
74+
}
75+
},
76+
"required": [
77+
"model",
78+
"prompt",
79+
"image_urls"
80+
],
81+
"title": "meta/muse-image-edit"
82+
}
83+
}
84+
}
85+
},
86+
"responses": {
87+
"200": {
88+
"content": {
89+
"application/json": {
90+
"schema": {
91+
"type": "object",
92+
"properties": {
93+
"data": {
94+
"type": "array",
95+
"nullable": true,
96+
"items": {
97+
"type": "object",
98+
"properties": {
99+
"url": {
100+
"type": "string",
101+
"nullable": true,
102+
"description": "The URL where the file can be downloaded from.",
103+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"
104+
},
105+
"b64_json": {
106+
"type": "string",
107+
"nullable": true,
108+
"description": "The base64-encoded JSON of the generated image.",
109+
"example": null
110+
}
111+
}
112+
},
113+
"description": "The list of generated images."
114+
},
115+
"meta": {
116+
"type": "object",
117+
"nullable": true,
118+
"properties": {
119+
"usage": {
120+
"type": "object",
121+
"nullable": true,
122+
"properties": {
123+
"credits_used": {
124+
"type": "number",
125+
"description": "The number of tokens consumed during generation.",
126+
"example": 120000
127+
},
128+
"usd_spent": {
129+
"type": "number",
130+
"description": "The total amount of money spent by the user in USD.",
131+
"example": 0.06
132+
}
133+
},
134+
"required": [
135+
"credits_used",
136+
"usd_spent"
137+
]
138+
}
139+
},
140+
"description": "Additional details about the generation."
141+
}
142+
}
143+
}
144+
}
145+
},
146+
"description": "Successful response."
147+
}
148+
},
149+
"x-hideTryItPanel": true,
150+
"x-codeSamples": [
151+
{
152+
"lang": "cURL",
153+
"source": "curl --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\"model\": \"meta/muse-image-edit\", \"prompt\": \"Describe what you want the model to generate.\", \"image_urls\": [\"https://example.com/input.jpg\"]}'"
154+
},
155+
{
156+
"lang": "JavaScript",
157+
"source": "const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"meta/muse-image-edit\",\n \"prompt\": \"Describe what you want the model to generate.\",\n \"image_urls\": [\n \"https://example.com/input.jpg\"\n ]\n}),\n});\n\nconsole.log(await response.json());"
158+
},
159+
{
160+
"lang": "Python",
161+
"source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/images/generations\",\n headers={\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n \"Content-Type\": \"application/json\",\n },\n json={'model': 'meta/muse-image-edit', 'prompt': 'Describe what you want the model to generate.', 'image_urls': ['https://example.com/input.jpg']},\n)\n\nprint(response.json())"
162+
}
163+
]
164+
}
165+
}
166+
},
167+
"components": {
168+
"securitySchemes": {
169+
"access-token": {
170+
"scheme": "bearer",
171+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
172+
"type": "http",
173+
"description": "Bearer key"
174+
}
175+
}
176+
}
177+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Meta Muse Image Edit
2+
3+
{% columns %}
4+
{% column width="66.66666666666666%" %}
5+
{% hint style="info" %}
6+
This documentation is valid for the following list of our models:
7+
8+
* `meta/muse-image-edit-edit`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/meta/muse-image-edit-edit" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Model Overview
18+
19+
Meta Muse Image Edit is an image-to-image model that makes precise edits that change only what you ask, stays coherent across turns, and composes from multiple reference images.
20+
21+
{% hint style="success" %}
22+
[Create AI/ML API Key](https://aimlapi.com/app/keys)
23+
{% endhint %}
24+
25+
<details>
26+
27+
<summary>How to make the first API call</summary>
28+
29+
**1️⃣ Required setup (don’t skip this)**\
30+
**Create an account:** Sign up on the AI/ML API website (if you don’t have one yet).\
31+
**Generate an API key:** In your account dashboard, create an API key and make sure it’s **enabled** in the UI.
32+
33+
**2️ Copy the code example**\
34+
At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.
35+
36+
**3️ Update the snippet for your use case**\
37+
**Insert your API key:** replace `<YOUR_AIMLAPI_KEY>` with your real AI/ML API key.\
38+
**Select a model:** set the `model` field to the model you want to call.\
39+
**Provide input:** fill in the request input field(s) shown in the example.
40+
41+
**4️ (Optional) Tune the request**\
42+
See the API schema below for optional generation settings.
43+
44+
**5️ Run your code**\
45+
Run the updated code in your development environment.
46+
47+
{% hint style="success" %}
48+
For a detailed walkthrough, use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
49+
{% endhint %}
50+
51+
</details>
52+
53+
## API Schema
54+
55+
{% openapi-operation spec="muse-image-edit" path="/v1/images/generations" method="post" %}
56+
[OpenAPI muse-image-edit](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/meta/muse-image-edit.json)
57+
{% endopenapi-operation %}
58+
59+
## Code Example
60+
61+
{% tabs %}
62+
{% tab title="Python" %}
63+
{% code overflow="wrap" %}
64+
```python
65+
import requests
66+
67+
response = requests.post(
68+
"https://api.aimlapi.com/v1/images/generations",
69+
headers={
70+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
71+
"Content-Type": "application/json",
72+
},
73+
json={'model': 'meta/muse-image-edit-edit', 'prompt': 'Describe what you want the model to generate.'},
74+
)
75+
76+
print(response.json())
77+
```
78+
{% endcode %}
79+
{% endtab %}
80+
81+
{% tab title="JavaScript" %}
82+
{% code overflow="wrap" %}
83+
```javascript
84+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
85+
method: 'POST',
86+
headers: {
87+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
88+
'Content-Type': 'application/json',
89+
},
90+
body: JSON.stringify({
91+
"model": "meta/muse-image-edit",
92+
"prompt": "Describe what you want the model to generate."
93+
}),
94+
});
95+
96+
console.log(await response.json());
97+
```
98+
{% endcode %}
99+
{% endtab %}
100+
{% endtabs %}
101+
102+
<details>
103+
104+
<summary>Response</summary>
105+
106+
{% code overflow="wrap" %}
107+
```json
108+
{
109+
"data": [
110+
{
111+
"url": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png",
112+
"b64_json": null
113+
}
114+
],
115+
"meta": {
116+
"usage": {
117+
"credits_used": 120000,
118+
"usd_spent": 0.06
119+
}
120+
},
121+
"model": "meta/muse-image-edit"
122+
}
123+
```
124+
{% endcode %}
125+
126+
</details>

0 commit comments

Comments
 (0)