mingyi456 commited on
Commit
450c139
·
verified ·
1 Parent(s): 3899264

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +39 -1
README.md CHANGED
@@ -6,4 +6,42 @@ library_name: diffusers
6
  license: other
7
  license_name: flux-1-dev-non-commercial-license
8
  license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
9
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  license: other
7
  license_name: flux-1-dev-non-commercial-license
8
  license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
9
+ ---
10
+
11
+ For more information (including how to compress models yourself), check out https://huggingface.co/DFloat11
12
+
13
+ Feel free to request for other models for compression as well, although I currently only know how to compress models based on the Flux architecture.
14
+
15
+
16
+ ### How to Use
17
+
18
+ #### `diffusers`
19
+
20
+ 1. Install the DFloat11 pip package *(installs the CUDA kernel automatically; requires a CUDA-compatible GPU and PyTorch installed)*:
21
+
22
+ ```bash
23
+ pip install dfloat11[cuda12]
24
+ # or if you have CUDA version 11:
25
+ # pip install dfloat11[cuda11]
26
+ ```
27
+ 2. To use the DFloat11 model, run the following example code in Python:
28
+ ```python
29
+ import torch
30
+ from diffusers import FluxPipeline
31
+ from dfloat11 import DFloat11Model
32
+ pipe = FluxPipeline.from_pretrained("mikeyandfriends/PixelWave_FLUX.1-dev_03", torch_dtype=torch.bfloat16)
33
+ pipe.enable_model_cpu_offload()
34
+ DFloat11Model.from_pretrained('mingyi456/pixelwave_flux1Dev03-DF11', device='cpu', bfloat16_model=pipe.transformer)
35
+ prompt = "A futuristic cityscape at sunset, with flying cars, neon lights, and reflective water canals"
36
+ image = pipe(
37
+ prompt,
38
+ guidance_scale=0.0,
39
+ num_inference_steps=30,
40
+ max_sequence_length=256,
41
+ generator=torch.Generator("cpu").manual_seed(0)
42
+ ).images[0]
43
+ image.save("PixelWave_FLUX.1-dev_03.png")
44
+ ```
45
+ #### ComfyUI
46
+
47
+ Follow the instructions (have not tested myself) here: https://github.com/LeanModels/ComfyUI-DFloat11