WikiQwen
Collection
Ask anything, get an illustrated how-to article: chat models, an illustration LoRA and the demo. • 9 items • Updated
How to use devon7y/WikiQwen-Illustrator-7B with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-2.1", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("devon7y/WikiQwen-Illustrator-7B")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]A style LoRA for Qwen-Image-2.1 that draws how-to step illustrations in a flat, clean house style from a one-sentence caption. It is the illustrator of the WikiQwen app, drawing a picture for every step of an article.
Sample with true classifier-free guidance. Qwen-Image-2.1 is meant to be sampled without guidance, but after this
much fine-tuning the LoRA needs it: without guidance the style is weaker and lettering falls apart. The settings below
(20 steps, true_cfg_scale=4, empty negative prompt) were chosen on held-out captions.
import torch
from diffusers import QwenImage21Pipeline # diffusers main (the pipeline is not in a release yet)
pipe = QwenImage21Pipeline.from_pretrained("Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16).to("cuda")
pipe.load_lora_weights("devon7y/WikiQwen-Illustrator-7B", weight_name="pytorch_lora_weights.safetensors")
image = pipe(prompt="A hand waters a potted basil plant on a sunny windowsill.", width=512, height=384,
num_inference_steps=20, true_cfg_scale=4.0, negative_prompt="").images[0]
image.convert("RGB").save("step.png") # the pipeline returns RGBA
Non-commercial research demo. Not affiliated with or endorsed by the source site.
Base model
Qwen/Qwen-Image-2.1