Disty0 commited on
Commit
babec99
·
verified ·
1 Parent(s): e7343cd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -0
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.
Free AI Image Generator No sign-up. Instant results. Open Now