Skip to content

Commit 0a125cb

Browse files
authored
[MUSA] add qwen-image i2i example (#683)
1 parent 6d3db5a commit 0a125cb

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"vae_scale_factor": 8,
3+
"infer_steps": 40,
4+
"transformer_in_channels": 64,
5+
"prompt_template_encode": "<|im_start|>system\nDescribe the key features of the input image (color, shape, size, texture, objects, background), then explain how the user's text instruction should alter or modify the image. Generate a new image that meets the user's requirements while maintaining consistency with the original input where appropriate.<|im_end|>\n<|im_start|>user\n{}<|im_end|>\n<|im_start|>assistant\n",
6+
"prompt_template_encode_start_idx": 64,
7+
"_auto_resize": true,
8+
"num_layers": 60,
9+
"attention_out_dim": 3072,
10+
"attention_dim_head": 128,
11+
"attn_type": "torch_sdpa",
12+
"enable_cfg": true,
13+
"sample_guide_scale": 4.0,
14+
"CONDITION_IMAGE_SIZE": 147456,
15+
"USE_IMAGE_ID_IN_PROMPT": true,
16+
"zero_cond_t": true,
17+
"modulate_type": "torch",
18+
"rope_type": "torch",
19+
"ln_type": "Default",
20+
"rms_type": "Default"
21+
}

configs/platforms/mthreads_musa/wan_t2v.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
"sample_shift": 8,
1212
"enable_cfg": true,
1313
"cpu_offload": false,
14-
"rope_type": "torch"
14+
"modulate_type": "torch",
15+
"rope_type": "torch",
16+
"ln_type": "Default",
17+
"rms_type": "Default"
1518
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# System management interface: mx-smi
4+
5+
# set path and first
6+
lightx2v_path=
7+
model_path=
8+
9+
export PLATFORM=musa
10+
export MUSA_VISIBLE_DEVICES=0
11+
12+
# set environment variables
13+
source ${lightx2v_path}/scripts/base/base.sh
14+
15+
python -m lightx2v.infer \
16+
--model_cls qwen_image \
17+
--task i2i \
18+
--model_path $model_path \
19+
--config_json ${lightx2v_path}/configs/platforms/mthreads_musa/qwen_image_i2i_2511.json \
20+
--prompt "Make the girl from Image 1 wear the black dress from Image 2 and sit in the pose from Image 3." \
21+
--negative_prompt " " \
22+
--image_path "1.png,2.png,3.png" \
23+
--save_result_path ${lightx2v_path}/save_results/qwen_image_i2i_2511.png \
24+
--seed 0

0 commit comments

Comments
 (0)