图片
FLUX.2 图像生成器
输入提示词,下载图片。在您连接的设备上免费文生图。
FLUX.2 klein by Black Forest Labs
FLUX.2 klein by Black Forest Labs; Qwen3 by Alibaba Cloud
模型许可证
FLUX.2 klein 4B fifteen-stage transformer · Apache-2.0
Retain full Apache-2.0 terms and copyright notices, mark modifications; patent termination and trademark limitations apply.
FLUX.2 klein VAE and shared pipeline/tokenizer derivatives · Apache-2.0
Retain complete Apache-2.0 licence, upstream copyright and NOTICE texts; prominently identify modified files. Patent termination and trademark limitations apply.
Qwen3-4B text encoder distributed by FLUX.2 klein · Apache-2.0
API 参考
通过 REST 提交
使用您的个人 API 密钥(msk_…),从您自己的工具为此工作负载创建任务。以这种方式启动的任务会在您于您的设备中连接的同一批设备上运行——至少需要有一台在线。
https://cp.meshlabs.cloud/v1/organizations/jobs使用 X-Organization-Api-Key: msk_your_personal_api_key 进行身份验证。该请求头名称与组织密钥相同;个人密钥使用相同的端点。
POST https://cp.meshlabs.cloud/v1/organizations/job-inputs/presign,将文件上传到返回的 upload_url,然后在 job_spec 中传入 download_url(例如作为 input_image_url)。请求体
{
"workload_type": "flux-2-klein-4b-t2i",
"job_spec": {
"prompt": "A photorealistic lighthouse at dusk",
"width": 512,
"height": 512,
"strength": 0.8,
"numSteps": 4,
"compression_method": "fp16",
"compression_error_threshold": 0.05,
"compression_hq8_block": 128
}
}job_spec 字段
| 字段 | 必填 | 默认值 | 说明 |
|---|---|---|---|
prompt | 是 | — | 用于图像生成的文字提示词 |
input_image_url | 否 | — | 用于图像编辑(img2img)的可选输入图片。设置后,图片会经 VAE 编码,并按“强度”与噪声混合;提示词描述期望的编辑效果。 |
width | 否 | 512 | 输出图片宽度,单位为像素 |
height | 否 | 512 | 输出图片高度,单位为像素 |
seed | 否 | — | 用于复现结果的随机种子 |
strength | 否 | 0.8 | img2img 噪声比例:0.3 = 轻微修饰,0.8 = 大幅编辑,1.0 = 忽略输入图片。仅在设置 input_image_url 时使用。 |
numSteps | 否 | 4 | 去噪步数(FLUX.2-klein 默认值:4) |
num_steps | 否 | — | Snake-case alias of numSteps. Omit it and numSteps is what runs. |
compression_method | 否 | fp16 | DiT 分片间激活值交接所用的编解码器。'off' 发送原始 Float32。hq8/hq4 = Hadamard 量化;stp = 低秩;fp16 = 半精度;auto8 = 择优路由。通过 codec_ms / transport_savings_pct 任务指标上报。 |
compression_error_threshold | 否 | 0.05 | 有损编解码器的相对 Frobenius 误差预算(0.01 严格 … 0.05 宽松)。 |
compression_hq8_block | 否 | 128 | HQ8/HQ4 的 Hadamard/量化块大小(2 的幂)。越小误差越低。 |
cURL
curl -X POST https://cp.meshlabs.cloud/v1/organizations/jobs \
-H "X-Organization-Api-Key: msk_your_personal_api_key" \
-H "Content-Type: application/json" \
-d '{
"workload_type": "flux-2-klein-4b-t2i",
"job_spec": {
"prompt": "A photorealistic lighthouse at dusk",
"width": 512,
"height": 512,
"strength": 0.8,
"numSteps": 4,
"compression_method": "fp16",
"compression_error_threshold": 0.05,
"compression_hq8_block": 128
}
}'https://cp.meshlabs.cloud/v1/organizations/jobs/{job_id}使用同一 API 密钥轮询,直到 status 进入终态(COMPLETED、FAILED、CANCELED 或 MODERATION_BLOCKED)。启用内容审核时,任务可能会先处于 MODERATION_PENDING 状态,然后才进入计算队列。已完成的任务会在每个输出上包含预签名的 download_url 值。
创建响应
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workload_type": "flux-2-klein-4b-t2i",
"status": "PENDING",
"job_spec_json": {
"prompt": "A photorealistic lighthouse at dusk",
"width": 512,
"height": 512,
"strength": 0.8,
"numSteps": 4,
"compression_method": "fp16",
"compression_error_threshold": 0.05,
"compression_hq8_block": 128
},
"work_units": [],
"outputs": [],
"created_at": "2026-06-08T12:00:00Z",
"updated_at": "2026-06-08T12:00:00Z"
}完成响应
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"workload_type": "flux-2-klein-4b-t2i",
"status": "COMPLETED",
"job_spec_json": {
"prompt": "A photorealistic lighthouse at dusk",
"width": 512,
"height": 512,
"strength": 0.8,
"numSteps": 4,
"compression_method": "fp16",
"compression_error_threshold": 0.05,
"compression_hq8_block": 128
},
"work_units": [
{
"id": "…",
"index": 0,
"status": "COMPLETED"
}
],
"outputs": [
{
"id": "…",
"output_type": "<output type>",
"filename": "<output filename>",
"size_bytes": 524288,
"download_url": "<presigned output download URL>"
}
],
"created_at": "2026-06-08T12:00:00Z",
"updated_at": "<completion timestamp>"
}输入提示词,下载图片。FLUX.2 Klein 是在您连接的设备上运行的免费在线文生图模型。首次运行会下载模型,之后的图片启动更快。这是根据空白提示词生成图片的生成器,不是指令式编辑器。