Prepare the model
Download the model weights from Qwen/Qwen-Image-2.1 on Hugging Face. You need Python 3.12 or newer,uv, and NVIDIA GPUs with CUDA support. Run the
following commands from the PhyAI repository root. Replace the checkpoint path
with the folder where you saved the model:
Generate an image
This example uses two GPUs and saves a 512 x 512 PNG. Check available GPUs withnvidia-smi, then adjust CUDA_VISIBLE_DEVICES if needed.
.cache/qwen_image_21.png to view the result. The script creates the output
folder automatically.
Edit an image
Set--image to your input image and describe the change in --prompt:
--image to provide multiple reference images, up to 10.
Common options
For one GPU, use
CUDA_VISIBLE_DEVICES=0 and --tp 1. For eight GPUs, use
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 and --tp 8.
To see all available options:

