Update README.md
Browse files
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.
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
torch_dtype=torch.bfloat16
|
68 |
-
qmodel_path="mit-han-lab/svdq-int4-flux.1-dev", # download from Huggingface
|
69 |
).to("cuda")
|
70 |
-
pipeline
|
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
|