Instructions to use Qwen/Qwen-Image with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Qwen/Qwen-Image 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", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Fix syntax error and hardcoded device
#64
by tossowski - opened
README.md
CHANGED
|
@@ -57,7 +57,7 @@ pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
|
|
| 57 |
pipe = pipe.to(device)
|
| 58 |
|
| 59 |
positive_magic = {
|
| 60 |
-
"en": "Ultra HD, 4K, cinematic composition." # for english prompt,
|
| 61 |
"zh": "超清,4K,电影级构图" # for chinese prompt,
|
| 62 |
}
|
| 63 |
|
|
@@ -87,7 +87,7 @@ image = pipe(
|
|
| 87 |
height=height,
|
| 88 |
num_inference_steps=50,
|
| 89 |
true_cfg_scale=4.0,
|
| 90 |
-
generator=torch.Generator(device=
|
| 91 |
).images[0]
|
| 92 |
|
| 93 |
image.save("example.png")
|
|
|
|
| 57 |
pipe = pipe.to(device)
|
| 58 |
|
| 59 |
positive_magic = {
|
| 60 |
+
"en": "Ultra HD, 4K, cinematic composition.", # for english prompt,
|
| 61 |
"zh": "超清,4K,电影级构图" # for chinese prompt,
|
| 62 |
}
|
| 63 |
|
|
|
|
| 87 |
height=height,
|
| 88 |
num_inference_steps=50,
|
| 89 |
true_cfg_scale=4.0,
|
| 90 |
+
generator=torch.Generator(device=device).manual_seed(42)
|
| 91 |
).images[0]
|
| 92 |
|
| 93 |
image.save("example.png")
|