timudk YiYiXu commited on
Commit
b36bebc
·
unverified ·
1 Parent(s): 0f0fe56

add diffusers weights (#8)

Browse files

- add diffusers weights (947474ad882d732c73918bfe6c43b0a8dc66d970)


Co-authored-by: YiYi Xu <[email protected]>

README.md CHANGED
@@ -32,6 +32,42 @@ The feature is supported in our latest model FLUX1.1 [pro] Ultra, allowing for c
32
 
33
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64510d6304397681bcf9725b/P123igomKjAkmitOzot8T.png)
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  ---
36
 
37
  # Limitations
 
32
 
33
  ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64510d6304397681bcf9725b/P123igomKjAkmitOzot8T.png)
34
 
35
+ ## Diffusers
36
+
37
+ To use `FLUX.1 Redux [pro]` with the 🧨 diffusers python library, first install or upgrade diffusers
38
+
39
+ ```shell
40
+ pip install -U diffusers
41
+ ```
42
+
43
+ Then you can use `FluxPriorReduxPipeline` along with `FluxPipeline` to generate images from images.
44
+
45
+ ```python
46
+ import torch
47
+ from diffusers import FluxPriorReduxPipeline, FluxPipeline
48
+ from diffusers.utils import load_image
49
+
50
+ pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained("black-forest-labs/FLUX.1-Redux-dev", torch_dtype=torch.bfloat16).to("cuda")
51
+ pipe = FluxPipeline.from_pretrained(
52
+ "black-forest-labs/FLUX.1-dev" ,
53
+ text_encoder=None,
54
+ text_encoder_2=None,
55
+ torch_dtype=torch.bfloat16
56
+ ).to("cuda")
57
+
58
+ image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png")
59
+ pipe_prior_output = pipe_prior_redux(image)
60
+ images = pipe(
61
+ guidance_scale=2.5,
62
+ num_inference_steps=50,
63
+ generator=torch.Generator("cpu").manual_seed(0),
64
+ **pipe_prior_output,
65
+ ).images
66
+ images[0].save("flux-dev-redux.png")
67
+ ```
68
+
69
+ To learn more check out the [diffusers](https://huggingface.co/docs/diffusers/main/en/api/pipelines/flux) documentation
70
+
71
  ---
72
 
73
  # Limitations
feature_extractor/preprocessor_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": null,
3
+ "do_normalize": true,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "image_mean": [
7
+ 0.5,
8
+ 0.5,
9
+ 0.5
10
+ ],
11
+ "image_processor_type": "SiglipImageProcessor",
12
+ "image_std": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "processor_class": "SiglipProcessor",
18
+ "resample": 3,
19
+ "rescale_factor": 0.00392156862745098,
20
+ "size": {
21
+ "height": 384,
22
+ "width": 384
23
+ }
24
+ }
image_embedder/config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ReduxImageEncoder",
3
+ "_diffusers_version": "0.32.0.dev0",
4
+ "redux_dim": 1152,
5
+ "txt_in_features": 4096
6
+ }
image_embedder/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02ace6d3b9dc6fa1ab77e6863151430a3ff128f0d0e378021ab9bcb7f2ed18f0
3
+ size 129008000
image_encoder/config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "SiglipVisionModel"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "hidden_act": "gelu_pytorch_tanh",
7
+ "hidden_size": 1152,
8
+ "image_size": 384,
9
+ "intermediate_size": 4304,
10
+ "layer_norm_eps": 1e-06,
11
+ "model_type": "siglip_vision_model",
12
+ "num_attention_heads": 16,
13
+ "num_channels": 3,
14
+ "num_hidden_layers": 27,
15
+ "patch_size": 14,
16
+ "torch_dtype": "bfloat16",
17
+ "transformers_version": "4.45.2"
18
+ }
image_encoder/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d769e3a32a6a9bac72d4d93b989e44491f71b50f02bfa14cd9187758d4a68ff1
3
+ size 856506120
model_index.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "FluxPriorReduxPipeline",
3
+ "_diffusers_version": "0.32.0.dev0",
4
+ "feature_extractor": [
5
+ "transformers",
6
+ "SiglipImageProcessor"
7
+ ],
8
+ "image_embedder": [
9
+ "flux",
10
+ "ReduxImageEncoder"
11
+ ],
12
+ "image_encoder": [
13
+ "transformers",
14
+ "SiglipVisionModel"
15
+ ]
16
+ }