Views
No views yet

1import torch
2from diffusers import QwenImagePipeline
3
4pipe = QwenImagePipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=torch.bfloat16)
5pipe.load_lora_weights("Shakker-Labs/AWPortrait-QW", weight_name="AWPortrait-QW_1.0.safetensors")
6pipe.fuse_lora(lora_scale=1.0)
7pipe.to("cuda")
8
9prompt = "Black and white portrait of an Asian woman with dynamic hair movement,wearing a dark jacket against a light background."
10
11image = pipe(
12 prompt=prompt,
13 negative_prompt="blurry, bad faces, bad hands, worst quality, low quality, jpeg artifacts",
14 width=1328,
15 height=1328,
16 num_inference_steps=30,
17 true_cfg_scale=4.0,
18 generator=torch.Generator(device="cuda").manual_seed(0),
19).images[0]
20image.save(f"example.png")