Text-to-Image
Diffusers
English
SVDQuant
FLUX.1-dev
INT4
FLUX.1
Diffusion
Quantization
LoRA
Lmxyy commited on
Commit
44409ed
·
verified ·
1 Parent(s): 0684a6e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -8
README.md CHANGED
@@ -59,18 +59,17 @@ Please follow the instructions in [mit-han-lab/nunchaku](https://github.com/mit-
59
 
60
  ```python
61
  import torch
 
62
 
63
- from nunchaku.pipelines import flux as nunchaku_flux
64
 
65
- pipeline = nunchaku_flux.from_pretrained(
66
- "black-forest-labs/FLUX.1-dev",
67
- torch_dtype=torch.bfloat16,
68
- qmodel_path="mit-han-lab/svdq-int4-flux.1-dev", # download from Huggingface
69
  ).to("cuda")
70
- pipeline.transformer.nunchaku_update_params(mit-han-lab/svdquant-models/svdq-flux.1-dev-lora-anime.safetensors)
71
- pipeline.transformer.nunchaku_set_lora_scale(1)
72
- image = pipeline("a dog wearing a wizard hat", num_inference_steps=28, guidance_scale=3.5).images[0]
73
  image.save("example.png")
 
74
  ```
75
 
76
  ### Comfy UI
 
59
 
60
  ```python
61
  import torch
62
+ from diffusers import FluxPipeline
63
 
64
+ from nunchaku.models.transformer_flux import NunchakuFluxTransformer2dModel
65
 
66
+ transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-int4-flux.1-dev")
67
+ pipeline = FluxPipeline.from_pretrained(
68
+ "black-forest-labs/FLUX.1-dev", transformer=transformer, torch_dtype=torch.bfloat16
 
69
  ).to("cuda")
70
+ image = pipeline("A cat holding a sign that says hello world", num_inference_steps=50, guidance_scale=3.5).images[0]
 
 
71
  image.save("example.png")
72
+
73
  ```
74
 
75
  ### Comfy UI