Text-to-Image
Diffusers
Safetensors
Ideogram4Pipeline
sdnq
ideogram
ideogram_4
4-bit precision
8-bit precision
Instructions to use Disty0/Ideogram-4-SDNQ-4bit-dynamic-hadamard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Disty0/Ideogram-4-SDNQ-4bit-dynamic-hadamard with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Disty0/Ideogram-4-SDNQ-4bit-dynamic-hadamard", torch_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
Update README.md
Browse files
README.md
CHANGED
|
@@ -33,8 +33,19 @@ import requests
|
|
| 33 |
import torch
|
| 34 |
import diffusers
|
| 35 |
from sdnq import SDNQConfig # import sdnq to register it into diffusers and transformers
|
|
|
|
|
|
|
| 36 |
|
| 37 |
pipe = diffusers.Ideogram4Pipeline.from_pretrained("Disty0/Ideogram-4-SDNQ-4bit-dynamic-hadamard", torch_dtype=torch.bfloat16)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
pipe.enable_model_cpu_offload()
|
| 39 |
|
| 40 |
# Expand the prompt into a structured JSON caption with Ideogram's free hosted magic-prompt API.
|
|
|
|
| 33 |
import torch
|
| 34 |
import diffusers
|
| 35 |
from sdnq import SDNQConfig # import sdnq to register it into diffusers and transformers
|
| 36 |
+
from sdnq.common import use_torch_compile as triton_is_available
|
| 37 |
+
from sdnq.loader import apply_sdnq_options_to_model
|
| 38 |
|
| 39 |
pipe = diffusers.Ideogram4Pipeline.from_pretrained("Disty0/Ideogram-4-SDNQ-4bit-dynamic-hadamard", torch_dtype=torch.bfloat16)
|
| 40 |
+
|
| 41 |
+
# Enable INT8 MatMul for AMD, Intel ARC and Nvidia GPUs:
|
| 42 |
+
if triton_is_available and (torch.cuda.is_available() or torch.xpu.is_available()):
|
| 43 |
+
pipe.transformer = apply_sdnq_options_to_model(pipe.transformer, use_quantized_matmul=True)
|
| 44 |
+
pipe.unconditional_transformer = apply_sdnq_options_to_model(pipe.unconditional_transformer, use_quantized_matmul=True)
|
| 45 |
+
pipe.text_encoder = apply_sdnq_options_to_model(pipe.text_encoder, use_quantized_matmul=True)
|
| 46 |
+
# pipe.transformer = torch.compile(pipe.transformer) # optional for faster speeds
|
| 47 |
+
# pipe.unconditional_transformer = torch.compile(pipe.unconditional_transformer) # optional for faster speeds
|
| 48 |
+
|
| 49 |
pipe.enable_model_cpu_offload()
|
| 50 |
|
| 51 |
# Expand the prompt into a structured JSON caption with Ideogram's free hosted magic-prompt API.
|