Risposta's picture
Include the tested API inference entry point with the weights
70cee68 verified
|
Raw History Blame Contribute Delete
2.02 kB

MC Gen 2.0 · api-step11516

原生 16×16 RGBA。使用两阶段迁移训练的联合验证最佳检查点(第 11,516 步)。

版本 条件编码方式 使用场景
本地版 · coarse-step8400 本机 Qwen3-VL-Embedding-8B 提取文本和视觉 token 离线生成
API 版 · api-step11516 北京百炼 qwen3-vl-embedding 分别返回文字和参考图的 2560 维向量 本机仅运行 MC 生成器

先克隆项目代码。

百炼 API 版

生成器仍在本机运行。新提示词和参考图会发往北京百炼进行向量化,结果缓存在 .cache/mcgen-api/。百炼按账号用量计费。本版下载一个推理文件即可,文件已包含生成器与适配器。

在项目根目录执行以下命令。请先在运行环境中设置北京地域的 DASHSCOPE_API_KEY。

pip install -e .
curl -fL -o scripts/sample_api.py https://huggingface.co/datasets/Risposta/MC_Gen/resolve/main/checkpoints/api-step11516/sample_api.py
curl -fL --create-dirs -o checkpoints/mcgen-api-step11516.pt \
  https://huggingface.co/datasets/Risposta/MC_Gen/resolve/main/checkpoints/api-step11516/mcgen-api-step11516.pt

# 文生图
python scripts/sample_api.py --checkpoint checkpoints/mcgen-api-step11516.pt \
  --prompt 'diamond sword' --seed 42 --out outputs/api-sword.png

# 图文联合;仅用参考图时省略 --prompt
python scripts/sample_api.py --checkpoint checkpoints/mcgen-api-step11516.pt \
  --prompt 'ruby battle axe' --reference path/to/item.png --out outputs/api-axe.png

默认使用 cuda:0 和 24 步 Heun 采样;CPU 推理可加 --device cpu。在 263 个配对测试目标上,API 版的编码空间 MAE 为纯文字 0.3691、纯参考图 0.3223、图文联合 0.3120(越低越好)。