Text-to-Image
Diffusers
Safetensors
English
Krea2Pipeline
image-generation
krea2
sdnq
8-bit precision
Instructions to use OzzyGT/Krea_2_Turbo_sdnq_dynamic_4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use OzzyGT/Krea_2_Turbo_sdnq_dynamic_4bit with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("OzzyGT/Krea_2_Turbo_sdnq_dynamic_4bit", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Upload 3 files
Browse files- .gitattributes +2 -0
- README.md +38 -2
- comparison_bf16_vs_sdnq.png +3 -0
- sample_benchmark.png +3 -0
.gitattributes
CHANGED
|
@@ -35,3 +35,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
LICENSE.pdf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
LICENSE.pdf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
comparison_bf16_vs_sdnq.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
sample_benchmark.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -18,8 +18,44 @@ library_name: diffusers
|
|
| 18 |
|
| 19 |
This is an int4 quantized version of [krea/Krea-2-Turbo](https://huggingface.co/krea/Krea-2-Turbo) using [SDNQ](https://github.com/Disty0/sdnq) (SD.Next Quantization) with the dynamic option and Hadamard Rotation.
|
| 20 |
|
| 21 |
-
Note: You need SDNQ v0.2.0 or
|
| 22 |
|
| 23 |
## Usage
|
| 24 |
|
| 25 |
-
You can find ready-to-use scripts in the [diffusers-recipes](https://github.com/asomoza/diffusers-recipes/blob/main/models/krea2_turbo/README.md) repository.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
This is an int4 quantized version of [krea/Krea-2-Turbo](https://huggingface.co/krea/Krea-2-Turbo) using [SDNQ](https://github.com/Disty0/sdnq) (SD.Next Quantization) with the dynamic option and Hadamard Rotation.
|
| 20 |
|
| 21 |
+
Note: You need SDNQ v0.2.0 or v0.2.2 and above (v0.2.1 is incompatible)
|
| 22 |
|
| 23 |
## Usage
|
| 24 |
|
| 25 |
+
You can find ready-to-use scripts in the [diffusers-recipes](https://github.com/asomoza/diffusers-recipes/blob/main/models/krea2_turbo/README.md) repository.
|
| 26 |
+
|
| 27 |
+
## Sample image
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
|
| 31 |
+
The sample above was generated with the following prompt and settings (seed `7`):
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
import sdnq # register the SDNQ backend before loading
|
| 35 |
+
import torch
|
| 36 |
+
from diffusers import DiffusionPipeline
|
| 37 |
+
|
| 38 |
+
pipe = DiffusionPipeline.from_pretrained("OzzyGT/Krea_2_Turbo_sdnq_dynamic_4bit", torch_dtype=torch.bfloat16)
|
| 39 |
+
pipe.to("cuda")
|
| 40 |
+
|
| 41 |
+
prompt = (
|
| 42 |
+
"A cozy corner bookstore-cafe on a rainy evening, cinematic wide shot. "
|
| 43 |
+
'A large hand-lettered chalkboard sign in the window reads "FRESH COFFEE & OLD BOOKS" '
|
| 44 |
+
"and below it in smaller chalk letters \"open 'til late\". "
|
| 45 |
+
"Warm golden light spills onto wet cobblestones that mirror pink and blue neon reflections. "
|
| 46 |
+
"Inside, tall mahogany shelves are packed with hundreds of colorful book spines with tiny legible titles, "
|
| 47 |
+
"a barista in a striped apron pours delicate latte art, steam curling upward, "
|
| 48 |
+
"a tabby cat sleeps on a windowsill beside a stack of paperbacks. "
|
| 49 |
+
"Intricate detail, sharp focus, shallow depth of field, photorealistic, rich color grading."
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
image = pipe(
|
| 53 |
+
prompt,
|
| 54 |
+
num_inference_steps=8,
|
| 55 |
+
guidance_scale=0.0,
|
| 56 |
+
height=1024,
|
| 57 |
+
width=1024,
|
| 58 |
+
generator=torch.Generator("cuda").manual_seed(7),
|
| 59 |
+
).images[0]
|
| 60 |
+
image.save("sample.png")
|
| 61 |
+
```
|
comparison_bf16_vs_sdnq.png
ADDED
|
Git LFS Details
|
sample_benchmark.png
ADDED
|
Git LFS Details
|