Muse Image 是 Meta 的图片生成模型 Muse Image 1.0,出自 Meta 超级智能实验室(Meta Superintelligence Labs)。Meta 介绍它会先对提示词做推理再出图,构图和文字渲染都很精确。在 APIMODELS 上它是统一图片端点里的一个模型名 muse-image(muse-image-1.0 也可以),文生图和图生图都用它:只传提示词就是文生图;再加 1-4 张参考图,就能改图、换风格,或把几张图里的东西合成一张。两种方式都是一个请求出一张约 2.5MP 的图,价格相同。蒙版和 4K 都不支持,传了直接返回 400,不会被悄悄忽略。并非每次请求都能成功;只有交付了图片才扣费,每张 $0.02。
Muse Image 能做什么、不能做什么,都在这张表里。接入前请逐条核对:文生图,或带 1-4 张参考图的图生图;一次一张,约 2.5MP,没有 4K,不支持蒙版。
| 项目 | 支持 | 不支持 |
|---|---|---|
| 输入 | 一段最多 4000 个字符的文字提示词;可以再加 1-4 张参考图做图生图(改图、换风格、多图合成),第 1 张是主图 | 蒙版(局部重绘) |
| 参考图 | 1-4 张,PNG、JPEG 或 WebP;单张最大 10 MB、合计最大 24 MB;公网 URL 或 base64 data URI | 超过 4 张(返回 400);其他图片格式 |
| 每次张数 | 1 张(n 只能是 1) | n 大于 1;批量请并行发多个请求 |
| 分辨率 | 约 2.5MP,按每种比例的原生尺寸出图:1:1 1600×1600、3:2 1920×1280、16:9 2048×1152、9:16 1152×2048、21:9 2352×1008;1024x1024 这类更小的 size 也交回原生尺寸 | 4K、2048x2048 或任何超过约 2.6MP 的 size(返回 400);精确的自定义像素 |
| 画幅 | auto(由提示词决定)或 1:1、3:2、2:3、4:3、3:4、5:4、4:5、16:9、9:16、2:1、1:2、21:9、9:21;OpenAI 风格 size,宽高比最多 16:1 | 列表外的 aspect_ratio;比 16:1 更长的 size |
| 输出格式 | 默认 JPEG;output_format 可选 PNG 或 WebP | 透明背景(background: "transparent" 返回 400);其他格式 |
| 其他控制 | — | negative_prompt、seed(结果不可复现)、画质档位(quality 可以传,但不起作用) |
不支持的取值和字段在建任务前返回 400,不扣费(唯一的例外是 quality:可以传,但会被忽略);报错原文见下方「常见报错」。
Muse Image 的成功率不是 100%。请求通过参数校验、建好任务之后,仍然可能失败:
失败的请求状态为 failed,原因在 data.failMsg,不扣费。我们 2026 年 10 月 30 日测试的 7 单都出了图,但 7 单远远不够说明成功率,所以我们不公布成功率。请按「偶尔会失败」来设计流程:临时错误重试,被拒的提示词改写后再发,不要假设第一次请求一定能拿到图。
同一个模型名、同一个端点,按你有没有传参考图来区分。两种方式同价,每张 $0.02。
| 方式 | 传什么 | 模型怎么用 |
|---|---|---|
| 文生图 | 只传 prompt | 整张图都按提示词生成;aspect_ratio 留 auto 时,形状也由提示词决定。 |
| 图生图(改图、换风格、多图合成) | prompt + 1-4 张参考图:一张放 image,多张放 images(image_url、image_urls 也可) | 第 1 张是主图。提示词说明哪些保留、哪些要改,也可以指名其他图(「第二张图里的杯子」)。出的仍是一张新的、约 2.5MP 的图。 |
一张参考图放 image(或 image_url),多张放 images(或 image_urls);两种一起传时,单张字段里的图排在最前面,合计最多 4 张。每张图是公网 URL 或 base64 data URI,PNG、JPEG 或 WebP,单张最大 10 MB、合计最大 24 MB。不支持蒙版:要改哪一块,直接写进提示词。
Authorization: Bearer YOUR_API_KEYhttps://api.apimodels.app/v1/images/generations·GET/v1/images/generations?task_id=# ─── Text-to-image, one image per request ────────────────
curl -X POST https://api.apimodels.app/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "muse-image",
"prompt": "A bakery storefront at dawn, a hand-painted sign that reads \"MORNING LOAF\", warm window light",
"aspect_ratio": "3:2"
}'
# Response (async — a task is created):
# { "code": 200, "msg": "success", "data": { "taskId": "clxxx", "state": "pending", "model": "muse-image" } }
# ─── Poll for the result ──────────────────────────────────
curl "https://api.apimodels.app/v1/images/generations?task_id=TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
# { "code": 200, "data": { "state": "completed", "resultUrls": ["https://r2.apimodels.app/..."],
# "images": [{ "url": "https://r2.apimodels.app/...", "width": 1920, "height": 1280 }] } }
# ─── One call, OpenAI style: an OpenAI-style size and no callback_url ──
curl -X POST https://api.apimodels.app/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "muse-image",
"prompt": "A minimalist travel poster of Kyoto in autumn, the title \"KYOTO\" in bold letters at the top",
"size": "2048x1152"
}'
# { "created": ...,
# "data": [{ "b64_json": "...", "url": "https://r2.apimodels.app/...", "width": 2048, "height": 1152 }],
# "size": "2048x1152" }默认是异步:建任务拿 taskId,再轮询 GET /v1/images/generations?task_id=,state 为 completed 时从 data.resultUrls 取图,data.images 给出实际宽高;failed 时原因在 data.failMsg,不扣费。我们测试中每张约 35-70 秒,每 5 秒轮询一次即可。想一次调用直接拿图,就传 OpenAI 风格的 size 且不带 callback_url:请求会一直等到出图,响应直接是 { created, data: [{ b64_json, url, width, height }], size },加 "response_format": "url" 可以不要 base64。OpenAI SDK 的 images.generate 拿到的也是这种一次返回的响应。
同一个模型名、同一个端点,在请求里加参考图即可,价格不变。一张用 image,多张用 images;第 1 张是主图。提示词里说明哪些保留、哪些要改,传多张时说明每张的用途。建好任务后,按上面文生图的方式轮询。
# ─── Image-to-image: 1 to 4 reference images, the first is the main image ──
# Same endpoint, model id and price ($0.02 per image) as text-to-image.
# image for one picture, images for several (image_url / image_urls also work);
# public URLs or base64 data URIs, PNG / JPEG / WebP, up to 10 MB each and 24 MB in total.
curl -X POST https://api.apimodels.app/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "muse-image",
"prompt": "Use the first image as the base and keep its lighting. Put the ceramic cup from the second image on the wooden table, next to the laptop",
"images": [
"https://example.com/desk-scene.jpg",
"https://example.com/ceramic-cup.png"
],
"aspect_ratio": "3:2"
}'
# Response (async — a task is created):
# { "code": 200, "msg": "success", "data": { "taskId": "clxxx", "state": "pending", "model": "muse-image" } }
# Poll the taskId exactly as in the text-to-image example.| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| model | 是 | string | muse-image(muse-image-1.0 也可) |
| prompt | 是 | string | 要画什么,最多 4000 个字符。图生图时写清楚哪些保留、哪些要改。 |
| image / image_url | 否 | string | 一张参考图,传了就是图生图:公网 URL 或 base64 data URI,PNG、JPEG 或 WebP,最大 10 MB。和 images 一起传时,它排在最前面,就是主图。 |
| images / image_urls | 否 | string[] | 参考图数组,1-4 张(连同 image 合计最多 4 张),第 1 张是主图。格式同上,单张最大 10 MB、合计最大 24 MB。超过 4 张返回 400。 |
| image_base64 / image_mime_type | 否 | string | 也可以用裸 base64(不带 data: 前缀)传一张参考图,类型写在 image_mime_type,例如 image/png。 |
| aspect_ratio | 否 | string | auto(默认,模型按提示词自选形状),或 1:1、3:2、2:3、4:3、3:4、5:4、4:5、16:9、9:16、2:1、1:2、21:9、9:21 之一。 |
| size | 否 | string | OpenAI 风格 "宽x高",如 2048x1152。只决定比例(最多 16:1):出图是该比例下模型的原生尺寸(约 2.5MP),所以 1024x1024 这样更小的 size 也交回 1600×1600。超过约 2.6MP 的 size(如 3840x2160、2048x2048)返回 400:没有 4K。size 优先于 aspect_ratio;不带 callback_url 时同一响应直接返回图片。 |
| n | 否 | number | 只能是 1(默认):一次请求一张图。 |
| output_format | 否 | string | 交付格式:"jpeg"(默认,质量 95)、"png" 或 "webp"。其他值返回 400。 |
| quality | 否 | string | 可以传,但不起作用:没有画质档位。 |
| callback_url | 否 | string | 任务完成后我们向该地址 POST 结果(格式见图片 API 总览)。 |
以下字段不支持,传了返回 400:mask、mask_url(蒙版 / 局部重绘),resolution: "4K",background: "transparent",negative_prompt,seed。参考图超过 4 张也返回 400。
每张约 2.5MP。比例由 aspect_ratio 或 size 决定,像素由模型决定:同一个比例总是交回同一个原生尺寸。没有 4K,也没有其他分辨率档位:size 只决定比例。更小的 size 交回原生尺寸;超过约 2.6MP 的 size(3840x2160、2048x2048)或 resolution "4K" 直接返回 400,不会缩小后交付。下表是我们 2026 年 10 月 30 日 7 单测试交回的尺寸。
| 比例 | 交回尺寸 | 说明 |
|---|---|---|
| 1:1 | 1600×1600 | size 1024x1024 也交回 1600×1600 |
| 16:9 | 2048×1152 | size 3840x2160 返回 400:没有 4K |
| 9:16 | 1152×2048 | — |
| 21:9 | 2352×1008 | — |
| auto | 1920×1280 | 一单测试;不传比例时由模型按提示词选形状 |
| 模型 | model | 价格 | 说明 |
|---|---|---|---|
| Muse Image | muse-image | $0.02/张 | 一口价,任何比例和尺寸同价,带不带参考图也同价;一次请求一张图 |
只有交付了图片才扣费;被 400 拒掉的请求不建任务、不扣费。带参考图不加价。计费示例:10 张 = $0.20,100 张 = $2.00。
参数问题在创建时同步返回 400({"code": 400, "msg": "..."}),不会建任务、不扣费;一次调用模式下同样的报错以 OpenAI 的格式返回:{"error": {"message": "...", "type": "invalid_request_error"}}。下表 msg 是当前原文,括号和 got 里的值随你的请求变化。
| msg | 原因 / 怎么改 |
|---|---|
prompt is required | 没传提示词,或只有空白。 |
prompt must be at most 4000 characters | 提示词超过 4000 个字符,删短。 |
muse-image does not support masks (mask): describe what to change in prompt instead | 传了蒙版(mask 或 mask_url)。不支持局部重绘:去掉蒙版,把要改的地方写进提示词。 |
muse-image takes at most 4 reference images (got 5) | 参考图超过 4 张(image、image_url、images、image_urls 里的图合在一起算;got 后面是你传的张数)。最多传 4 张,第 1 张是主图。 |
muse-image generates one image per request (got n=2); submit one request per image | n 大于 1。改成 1(或不传);要多张就并行发多个请求。 |
aspect_ratio must be one of auto, 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 21:9, 9:21 | aspect_ratio 不在列表里(例如 7:3)。换成列表里的值,或改传 size。 |
size must be "WIDTHxHEIGHT", e.g. 2048x1152 (got "…") | size 不是「宽x高」写法(例如传了 "2K")。改成 2048x1152 这样的格式。 |
output_format must be one of jpeg, png, webp (got "…") | output_format 不是 jpeg、png、webp 之一(例如传了 "gif")。不传就是 JPEG。 |
size 4000x200 is out of range (aspect ratio up to 16:1) | size 的宽高比超过 16:1。 |
size 3840x2160 is larger than muse-image can render: output is about 2.5 megapixels (1600x1600 at 1:1, 2048x1152 at 16:9), there is no 4K — use a smaller size or just aspect_ratio | size 超过约 2.6MP(例如 3840x2160、2048x2048;消息里是你发送的 size)。没有 4K:改用更小的 size,或只传 aspect_ratio。 |
muse-image has no 4K output: images are about 2.5 megapixels (1600x1600 at 1:1, 2048x1152 at 16:9) — remove resolution | resolution 传了 "4K"。没有 4K 档位,去掉 resolution。 |
muse-image does not support transparent backgrounds | background 传了 "transparent"。没有透明背景:去掉这个字段,或换支持透明背景的模型。 |
muse-image does not support negative_prompt — describe what you want in prompt instead | 传了 negative_prompt。没有反向提示词:去掉它,把想要的画面正面写进 prompt。 |
muse-image does not support seed: results are not repeatable | 传了 seed。没有 seed,同一提示词每次出的图都不同;去掉它。 |
试一试:Playground。
Muse Image 文生图和图生图都能做。图生图收 1-4 张参考图(第 1 张为主图),公网 URL 或 base64 data URI,PNG、JPEG 或 WebP,单张最大 10 MB、合计最大 24 MB;不支持蒙版(局部重绘),要改哪里就写进提示词。每个请求出一张(n 只能是 1),约 2.5MP,按比例的原生尺寸出图(1:1 1600×1600、16:9 2048×1152);没有 4K,超过约 2.6MP 的 size 会被拒,也不能指定精确像素。aspect_ratio 为 auto 或 13 种比例之一,OpenAI 风格 size 最多 16:1。默认交付 JPEG,output_format 可选 PNG / WebP,没有透明背景。不支持 negative_prompt 和 seed(结果不可复现),quality 不起作用,提示词最多 4000 个字符。不支持的字段、蒙版和超过 4 张的参考图在建任务前返回 400。成功率不是 100%:模型可能拒绝内容或遇到临时错误;失败的请求会返回原因、不扣费,我们也不公布成功率。
可以。在同一个请求里加 1-4 张参考图:一张用 image,多张用 images(image_url、image_urls 也可),公网 URL 或 base64 data URI,PNG、JPEG 或 WebP,单张最大 10 MB、合计最大 24 MB。第 1 张是主图。提示词里写清楚哪些保留、哪些要改(「保留人物和位置,背景换成海滩,油画风格」);传多张时说明每张图的用途(「以第一张图为底,把第二张图里的杯子放到桌上」)。带参考图不加价,仍是每张 $0.02。不支持蒙版(局部重绘),参考图超过 4 张返回 400。
每张固定 $0.02,任何比例和尺寸同价,带不带参考图也同价,只有交付了图片才扣费:10 张 $0.20,100 张 $2.00。被 400 拒掉的请求不扣费。
约 2.5MP,总是该比例下模型的原生尺寸。实测 1:1 交回 1600×1600、16:9 交回 2048×1152、9:16 交回 1152×2048、21:9 交回 2352×1008,不指定尺寸的一单交回 1920×1280。size 只决定比例,而且没有 4K:超过约 2.6MP 的 size(如 3840x2160、2048x2048)会返回 400,1024x1024 这类更小的 size 交回原生尺寸。默认交付 JPEG(质量 95),output_format 传 png 或 webp 可换成对应格式。
我们 2026 年 10 月 30 日的 7 单测试里,每张约 35-70 秒。每 5 秒轮询一次,或传 callback_url;一次调用模式下,HTTP 客户端超时至少设 2 分钟。
每个请求只出一张,n 大于 1 会返回 400,所以并行发多个请求即可;每个请求按 $0.02 单独计费、单独可查。
可以。把 OpenAI SDK 的 base_url 设为 https://api.apimodels.app/v1,用 images.generate 传 model muse-image 和 size(如 2048x1152),图片在同一个响应里返回(b64_json 加 url)。不用 SDK 时,传 OpenAI 风格的 size 且不带 callback_url,也是一次返回。