Niansuh commited on
Commit
ea53c39
1 Parent(s): 905a260

Upload 2 files

Browse files
Files changed (2) hide show
  1. README.md +30 -0
  2. model_index.json +32 -0
README.md CHANGED
@@ -31,6 +31,36 @@ The FLUX.1 models are also available via API from the following sources
31
  ## ComfyUI
32
  `FLUX.1 [schnell]` is also available in [Comfy UI](https://github.com/comfyanonymous/ComfyUI) for local inference with a node-based workflow.
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ---
35
  # Limitations
36
  - This model is not intended or able to provide factual information.
 
31
  ## ComfyUI
32
  `FLUX.1 [schnell]` is also available in [Comfy UI](https://github.com/comfyanonymous/ComfyUI) for local inference with a node-based workflow.
33
 
34
+ ## Diffusers
35
+ To use `FLUX.1 [schnell]` with the 🧨 diffusers python library, first install or upgrade diffusers
36
+
37
+ ```shell
38
+ pip install git+https://github.com/huggingface/diffusers.git
39
+ ```
40
+
41
+ Then you can use `FluxPipeline` to run the model
42
+
43
+ ```python
44
+ import torch
45
+ from diffusers import FluxPipeline
46
+
47
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16)
48
+ pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
49
+
50
+ prompt = "A cat holding a sign that says hello world"
51
+ image = pipe(
52
+ prompt,
53
+ guidance_scale=0.0,
54
+ output_type="pil",
55
+ num_inference_steps=4,
56
+ max_sequence_length=256,
57
+ generator=torch.Generator("cpu").manual_seed(0)
58
+ ).images[0]
59
+ image.save("flux-schnell.png")
60
+ ```
61
+
62
+ To learn more check out the [diffusers](https://huggingface.co/docs/diffusers/main/en/api/pipelines/flux) documentation
63
+
64
  ---
65
  # Limitations
66
  - This model is not intended or able to provide factual information.
model_index.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "FluxPipeline",
3
+ "_diffusers_version": "0.30.0.dev0",
4
+ "scheduler": [
5
+ "diffusers",
6
+ "FlowMatchEulerDiscreteScheduler"
7
+ ],
8
+ "text_encoder": [
9
+ "transformers",
10
+ "CLIPTextModel"
11
+ ],
12
+ "text_encoder_2": [
13
+ "transformers",
14
+ "T5EncoderModel"
15
+ ],
16
+ "tokenizer": [
17
+ "transformers",
18
+ "CLIPTokenizer"
19
+ ],
20
+ "tokenizer_2": [
21
+ "transformers",
22
+ "T5TokenizerFast"
23
+ ],
24
+ "transformer": [
25
+ "diffusers",
26
+ "FluxTransformer2DModel"
27
+ ],
28
+ "vae": [
29
+ "diffusers",
30
+ "AutoencoderKL"
31
+ ]
32
+ }