Upload 4 files
Browse files- .gitattributes +35 -35
- README.md +77 -0
- config.json +20 -0
- diffusion_pytorch_model.safetensors +3 -0
.gitattributes
CHANGED
@@ -1,35 +1,35 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model:
|
3 |
+
- black-forest-labs/FLUX.1-dev
|
4 |
+
library_name: diffusers
|
5 |
+
license: other
|
6 |
+
license_name: flux-1-dev-non-commercial-license
|
7 |
+
license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
|
8 |
+
pipeline_tag: image-to-image
|
9 |
+
inference: False
|
10 |
+
tags:
|
11 |
+
- ControlNet
|
12 |
+
- super-resolution
|
13 |
+
- upscaler
|
14 |
+
---
|
15 |
+
# ⚡ Flux.1-dev: Upscaler ControlNet ⚡
|
16 |
+
|
17 |
+
This is [Flux.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev) ControlNet for low resolution images developed by Jasper research team.
|
18 |
+
|
19 |
+
<p align="center">
|
20 |
+
<img style="width:700px;" src="examples/showcase.jpg">
|
21 |
+
</p>
|
22 |
+
|
23 |
+
# How to use
|
24 |
+
This model can be used directly with the `diffusers` library
|
25 |
+
|
26 |
+
```python
|
27 |
+
import torch
|
28 |
+
from diffusers.utils import load_image
|
29 |
+
from diffusers import FluxControlNetModel
|
30 |
+
from diffusers.pipelines import FluxControlNetPipeline
|
31 |
+
|
32 |
+
# Load pipeline
|
33 |
+
controlnet = FluxControlNetModel.from_pretrained(
|
34 |
+
"jasperai/Flux.1-dev-Controlnet-Upscaler",
|
35 |
+
torch_dtype=torch.bfloat16
|
36 |
+
)
|
37 |
+
pipe = FluxControlNetPipeline.from_pretrained(
|
38 |
+
"black-forest-labs/FLUX.1-dev",
|
39 |
+
controlnet=controlnet,
|
40 |
+
torch_dtype=torch.bfloat16
|
41 |
+
)
|
42 |
+
pipe.to("cuda")
|
43 |
+
|
44 |
+
# Load a control image
|
45 |
+
control_image = load_image(
|
46 |
+
"https://huggingface.co/jasperai/Flux.1-dev-Controlnet-Upscaler/resolve/main/examples/input.jpg"
|
47 |
+
)
|
48 |
+
|
49 |
+
w, h = control_image.size
|
50 |
+
|
51 |
+
# Upscale x4
|
52 |
+
control_image = control_image.resize((w * 4, h * 4))
|
53 |
+
|
54 |
+
image = pipe(
|
55 |
+
prompt="",
|
56 |
+
control_image=control_image,
|
57 |
+
controlnet_conditioning_scale=0.6,
|
58 |
+
num_inference_steps=28,
|
59 |
+
guidance_scale=3.5,
|
60 |
+
height=control_image.size[1],
|
61 |
+
width=control_image.size[0]
|
62 |
+
).images[0]
|
63 |
+
image
|
64 |
+
```
|
65 |
+
|
66 |
+
<p align="center">
|
67 |
+
<img style="width:500px;" src="examples/output.jpg">
|
68 |
+
</p>
|
69 |
+
|
70 |
+
|
71 |
+
# Training
|
72 |
+
This model was trained with a synthetic complex data degradation scheme taking as input a *real-life* image and artificially degrading it by combining several degradations such as amongst other image noising (Gaussian, Poisson), image blurring and JPEG compression in a similar spirit as [1]
|
73 |
+
|
74 |
+
[1] Wang, Xintao, et al. "Real-esrgan: Training real-world blind super-resolution with pure synthetic data." Proceedings of the IEEE/CVF international conference on computer vision. 2021.
|
75 |
+
|
76 |
+
# Licence
|
77 |
+
This model falls under the [Flux.1-dev model licence](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md).
|
config.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "FluxControlNetModel",
|
3 |
+
"_diffusers_version": "0.31.0.dev0",
|
4 |
+
"_name_or_path": "/data/checkpoints/flux_controlnet_hf/controlnet_upscaling//",
|
5 |
+
"attention_head_dim": 128,
|
6 |
+
"axes_dims_rope": [
|
7 |
+
16,
|
8 |
+
56,
|
9 |
+
56
|
10 |
+
],
|
11 |
+
"guidance_embeds": true,
|
12 |
+
"in_channels": 64,
|
13 |
+
"joint_attention_dim": 4096,
|
14 |
+
"num_attention_heads": 24,
|
15 |
+
"num_layers": 5,
|
16 |
+
"num_mode": null,
|
17 |
+
"num_single_layers": 0,
|
18 |
+
"patch_size": 1,
|
19 |
+
"pooled_projection_dim": 768
|
20 |
+
}
|
diffusion_pytorch_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2a7ea24d2037ff2aa4d25f8b4ce9fe7e739a2cfe6b9d05106788005d5058c8ca
|
3 |
+
size 3583232168
|