Qwen-Image-Edit-2511 MobileGUI (Full FT) 推理说明
文件清单
infer_mobilegui.py推理脚本step-5060.safetensors训练得到的 full-finetune 权重(DiT 部分)DiffSynth-Studio-code.tar.gzDiffSynth-Studio 代码(已排除 .git 和 models)README_INFER.md本文件
基础模型(需自行下载)
脚本会从 DiffSynth-Studio 的 ./models/ 目录加载:
Qwen/Qwen-Image-Edit-2511→ transformer/diffusion_pytorch_model*.safetensorsQwen/Qwen-Image→ text_encoder/model*.safetensors, vae/diffusion_pytorch_model.safetensorsQwen/Qwen-Image-Edit→ processor/
从 ModelScope 下载: modelscope download --model Qwen/Qwen-Image-Edit-2511 --local_dir ./models/Qwen/Qwen-Image-Edit-2511 modelscope download --model Qwen/Qwen-Image --local_dir ./models/Qwen/Qwen-Image modelscope download --model Qwen/Qwen-Image-Edit --local_dir ./models/Qwen/Qwen-Image-Edit
Prompt 构建格式
训练和推理都使用固定模板:
Predict the next page state via image from this current screenshot using action description "<ACTION_DESC>" and action target "<TARGET_DESC>" and relative coordinates "[x, y]".
举例:
Predict the next page state via image from this current screenshot using action description "Tap on the Firefox Browser icon to open the Firefox app and begin searching for top video blogs on fitness workouts." and action target "Firefox Browser app icon in the bottom right corner of the screen" and relative coordinates "[0.791, 0.922]".
字段说明:
edit_image: 当前屏幕截图(输入图)image: 动作执行后的下一帧(groundtruth,推理时不需要)prompt: 上述模板拼接好的文本- 相对坐标 [x, y] ∈ [0, 1],原点左上角
运行
解压 DiffSynth-Studio: tar xzf DiffSynth-Studio-code.tar.gz
装 diffsynth(Python >=3.10, 需 torch>=2.0, CUDA 12.x): cd DiffSynth-Studio && pip install -e . && cd ..
把基础模型放到 DiffSynth-Studio/models/Qwen/... 下
调整 infer_mobilegui.py 顶部的路径常量(PROJECT / DIFFSYNTH / DATA_BASE 等),或者用 CLI 参数覆盖: python infer_mobilegui.py --mode full
--ckpt-full /path/to/step-5060.safetensors
--metadata /path/to/your_metadata.json
--num-samples 3 --num-steps 40 --seed 123说明: --mode full 用完整 checkpoint(本次提供的 step-5060.safetensors) --low-vram 如显存不足,可加此开关(~20GB VRAM, 更慢) 默认输出目录 /storage/ljx/infer_outputs,可用 --output-dir 指定
metadata JSON 每条记录需包含 {"prompt": ..., "edit_image": ..., "image": ...} 三个字段(推理时 image 可随意填,只用来做对比)。edit_image/image 路径相对 DATA_BASE。
显存要求
- 完整加载:单卡 ~60GB(A100 80G / A800 80G 可跑)
- --low-vram:~20GB VRAM + ~40GB CPU RAM(慢 2-3 倍)