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
Update Postive_magic as a dict from list
#8
by voidcoder - opened
README.md
CHANGED
|
@@ -55,10 +55,10 @@ else:
|
|
| 55 |
pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
|
| 56 |
pipe = pipe.to(device)
|
| 57 |
|
| 58 |
-
positive_magic =
|
| 59 |
"en": "Ultra HD, 4K, cinematic composition." # for english prompt,
|
| 60 |
"zh": "超清,4K,电影级构图" # for chinese prompt,
|
| 61 |
-
|
| 62 |
|
| 63 |
# Generate image
|
| 64 |
prompt = '''A coffee shop entrance features a chalkboard sign reading "Qwen Coffee 😊 $2 per cup," with a neon light beside it displaying "通义千问". Next to it hangs a poster showing a beautiful Chinese woman, and beneath the poster is written "π≈3.1415926-53589793-23846264-33832795-02384197". Ultra HD, 4K, cinematic composition'''
|
|
|
|
| 55 |
pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
|
| 56 |
pipe = pipe.to(device)
|
| 57 |
|
| 58 |
+
positive_magic = {
|
| 59 |
"en": "Ultra HD, 4K, cinematic composition." # for english prompt,
|
| 60 |
"zh": "超清,4K,电影级构图" # for chinese prompt,
|
| 61 |
+
}
|
| 62 |
|
| 63 |
# Generate image
|
| 64 |
prompt = '''A coffee shop entrance features a chalkboard sign reading "Qwen Coffee 😊 $2 per cup," with a neon light beside it displaying "通义千问". Next to it hangs a poster showing a beautiful Chinese woman, and beneath the poster is written "π≈3.1415926-53589793-23846264-33832795-02384197". Ultra HD, 4K, cinematic composition'''
|