kpsss34/Qwen-Image-8PR is a model that cuts out unimportant parts (in the text_encoder part), thus making the model smaller in size.
from diffusers import QwenImagePipeline
import torch
model_name = "kpsss34/Qwen-Image-8PR"
if torch.cuda.is_available():
torch_dtype = torch.bfloat16
device = "cuda"
else:
torch_dtype = torch.float32
device = "cpu"
pipe = QwenImagePipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
pipe = pipe.to(device)
#pipe.enable_model_cpu_offload() #If you have less than 40GB of vram
positive_magic = {
"en": ", Ultra HD, 4K, cinematic composition.",
"zh": ", 超清,4K,电影级构图."
}
prompt = '''a medium shot of a woman with long blonde hair, wearing a green sweater and looking to the left. her eyes are slightly open, and she has a serious expression on her face. her lips are red, and her teeth are slightly visible'''
negative_prompt = " "
aspect_ratios = {
"1:1": (1024, 1024),
"16:9": (1280, 720),
"9:16": (720, 1280),
}
width, height = aspect_ratios["1:1"]
image = pipe(
prompt=prompt + positive_magic["en"],
negative_prompt=negative_prompt,
width=width,
height=height,
num_inference_steps=30,
true_cfg_scale=4.0,
generator=torch.Generator(device="cuda").manual_seed(42)
).images[0]
image.save("example.png")
- Downloads last month
- 7
Model tree for kpsss34/Qwen-Image-8PR
Base model
Qwen/Qwen-Image