MOSS Image 文生图
moss-image/text-to-image
支持中英文文字渲染、15 种宽高比和 1K~2K 输出的文生图模型。
示例
参数
| 名称 | 类型 | 默认 | 约束 | 说明 |
|---|---|---|---|---|
| prompt *提示词 | textarea | — | ≤ 5000 chars | 用于生成的正向提示词。支持较长且详细的提示词,并可在图片中渲染中英文文字。 |
| aspect_ratio宽高比 | select | 1:1 | 1:1 | 1:2 | 2:1 | 1:3 | 3:1 | 2:3 | 3:2 | 3:4 | … | 生成图片的宽高比。 |
| resolution分辨率 | select | 1k | 1k | 1.5k | 2k | 输出总分辨率档位:1k(约 100 万像素)、1.5k(约 240 万像素)或 2k(约 400 万像素)。 |
| output_format输出格式 | select | jpeg | jpeg | png | webp | 输出图片的格式。 |
| seed随机种子 | number | — | step 1 | 用于生成的随机种子。-1 表示将使用随机种子。 |
输出字段
| 字段 | 类型 | 说明 |
|---|---|---|
| images | array<string> |
API
通过统一 REST API 调用本模型;在 API Keys 页获取密钥。
cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/moss-image/text-to-image" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "A modern tea house poster with a sign reading \"MOSS TEA HOUSE\", warm lighting and clean typography.",
"aspect_ratio": "1:1",
"resolution": "1k",
"output_format": "jpeg",
"seed": -1
}
}'
# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
-H "Authorization: Bearer YOUR_API_KEY"Python
import time, requests
API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1) Submit
resp = requests.post(
"https://www.namifusion.com/api/v1/marketplace/run/moss-image/text-to-image",
headers=HEADERS,
json={
"input": {
"prompt": "A modern tea house poster with a sign reading \"MOSS TEA HOUSE\", warm lighting and clean typography.",
"aspect_ratio": "1:1",
"resolution": "1k",
"output_format": "jpeg",
"seed": -1
}
},
)
resp.raise_for_status() # 401/402/429/5xx stop here instead of polling a bad task
task = resp.json()
# 2) Poll until a terminal state (completed / failed / cancelled).
# This model is allowed up to 1800s server-side.
deadline = time.time() + 1860
while task.get("status") not in ("completed", "failed", "cancelled"):
if time.time() > deadline:
raise TimeoutError(f"still {task.get('status')} — keep the task_uuid and poll later")
time.sleep(3)
poll = requests.get(f"https://www.namifusion.com/api/v1/marketplace/run/tasks/{task['task_uuid']}", headers=HEADERS)
poll.raise_for_status()
task = poll.json()
print(task["status"], task.get("output"))JavaScript
const API_KEY = "YOUR_API_KEY";
const HEADERS = { Authorization: `Bearer ${API_KEY}` };
// 1) Submit
const resp = await fetch("https://www.namifusion.com/api/v1/marketplace/run/moss-image/text-to-image", {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({
"input": {
"prompt": "A modern tea house poster with a sign reading \"MOSS TEA HOUSE\", warm lighting and clean typography.",
"aspect_ratio": "1:1",
"resolution": "1k",
"output_format": "jpeg",
"seed": -1
}
}),
});
if (!resp.ok) throw new Error(`submit failed: ${resp.status} ${await resp.text()}`);
let task = await resp.json();
// 2) Poll until a terminal state (completed / failed / cancelled).
// This model is allowed up to 1800s server-side.
const deadline = Date.now() + 1860 * 1000;
while (!["completed", "failed", "cancelled"].includes(task.status)) {
if (Date.now() > deadline) throw new Error(`still ${task.status} — keep the task_uuid and poll later`);
await new Promise((r) => setTimeout(r, 3000));
const poll = await fetch(`https://www.namifusion.com/api/v1/marketplace/run/tasks/${task.task_uuid}`, { headers: HEADERS });
if (!poll.ok) throw new Error(`poll failed: ${poll.status}`);
task = await poll.json();
}
console.log(task.status, task.output);文档
MOSS Image 文生图
moss-image/text-to-image
支持中英文文字渲染、15 种宽高比和 1K~2K 输出的文生图模型。
输入参数
| 参数 | 类型 | 必填 | 默认值 | 限制与说明 |
|---|---|---|---|---|
prompt | string | 是 | — | 最多 5000 字符(平台限制); 用于生成的正向提示词。支持较长且详细的提示词,并可在图片中渲染中英文文字。 |
aspect_ratio | string | 否 | "1:1" | 1:1, 1:2, 2:1, 1:3, 3:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9; 生成图片的宽高比。 |
resolution | string | 否 | "1k" | 1k, 1.5k, 2k; 输出总分辨率档位:1k(约 100 万像素)、1.5k(约 240 万像素)或 2k(约 400 万像素)。 |
output_format | string | 否 | "jpeg" | jpeg, png, webp; 输出图片的格式。 |
seed | integer | 否 | — | 用于生成的随机种子。-1 表示将使用随机种子。 |
仅 prompt 必填。seed 必须为整数,-1 表示随机种子。resolution 是总像素档位,并非固定宽度或高度。本 Nami 接口返回异步任务及图片 URL,不开放上游的 enable_sync_mode 和 enable_base64_output 开关。
每张图片价格
| Resolution | USD | Credits |
|---|---|---|
| 1k | $0.020 | 2 |
| 1.5k | $0.040 | 4 |
| 2k | $0.080 | 8 |
每次请求生成一张图片。标价与 WaveSpeed 一致,1 美元 = 100 积分。只有 resolution 影响价格,宽高比、输出格式和种子不额外收费;账户折扣另行计算。
API
curl -X POST https://www.namifusion.com/api/v1/marketplace/run/moss-image/text-to-image \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"input": {
"prompt": "A modern tea house poster with a sign reading \"MOSS TEA HOUSE\", warm lighting and clean typography.",
"aspect_ratio": "1:1",
"resolution": "1k",
"output_format": "jpeg",
"seed": -1
}
}'
curl 'https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID' \
-H "Authorization: Bearer $API_KEY"
提交一次,从响应读取 task_uuid,再轮询至 completed 或 failed。完成后 output.images 为图片 URL 数组。
相关模型
z-image-spicy/text-to-image
从文本提示生成高质量图片,支持 256 至 1536 像素自定义尺寸、智能提示词扩写和随机种子,适合创意设计与批量出图。
xAI Grok Imagine Image v2.0 文生图
xAI Grok Imagine Image V2.0 文生图可根据文本提示词生成高质量图片,并支持配置宽高比、分辨率和质量,适用于创意视觉、社交内容、营销素材和生产工作流。提供开箱即用的 REST 推理 API,性能出色,无冷启动,价格实惠。
Qwen Image 3.0 Pro 文生图
Qwen Image 3.0 Pro 是一款专业级文生图模型,具备卓越画质和先进的提示词理解能力。最高支持 2k。提供开箱即用的 REST inference API,性能出色,无冷启动,价格实惠。
ai/prefect-pony-xl 动漫风格图片生成模型
Prefect Pony XL 可高质量生成动漫风格图片,适用于角色立绘和插画创作。提供开箱即用的 REST 推理 API,性能出色,无冷启动,价格实惠。
OpenAI GPT Image 2 文本生成图片
OpenAI 的 GPT Image 2 文本生成图片模型可根据自然语言提示词生成高质量图片。提供即用型 REST 推理 API,性能最佳,无冷启动,价格实惠。
OpenAI GPT Image 2 Edit 图像编辑
OpenAI 的 GPT Image 2 Edit 可通过自然语言指令结合一张或多张参考图片进行图像编辑。提供即用型 REST 推理 API,性能最佳,无冷启动,价格实惠。
OpenAI GPT Image 2.5 Sunburst 文本生成图片
面向复杂构图和高要求生产场景的高保真图片生成,最高支持 4K 输出。
OpenAI GPT Image 2.5 Flare 文本生成图片
根据自然语言提示词快速生成高质量图片,兼顾速度与效果,最高支持 4K 输出。