bertjiazheng commited on
Commit
6e4996d
·
1 Parent(s): b9c6c8a

update README

Browse files
.gitattributes CHANGED
@@ -33,3 +33,7 @@ saved_model/**/* 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
 
 
 
 
 
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
36
+ assets/Cyberpunk_style.png filter=lfs diff=lfs merge=lfs -text
37
+ assets/Cartoon_style.png filter=lfs diff=lfs merge=lfs -text
38
+ assets/Chinese_style.png filter=lfs diff=lfs merge=lfs -text
39
+ assets/European_style.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,6 +1,97 @@
1
- ---
2
- license: other
3
- license_name: flux-1-dev-non-commercial-license
4
- license_link: >-
5
- https://github.com/black-forest-labs/flux/blob/main/model_licenses/LICENSE-FLUX1-dev
6
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: flux-1-dev-non-commercial-license
4
+ license_link: >-
5
+ https://github.com/black-forest-labs/flux/blob/main/model_licenses/LICENSE-FLUX1-dev
6
+ base_model:
7
+ - black-forest-labs/FLUX.1-dev
8
+ tags:
9
+ - image-generation
10
+ - flux
11
+ - controlnet
12
+ ---
13
+
14
+ ## FLUX.1-Layout-ControlNet
15
+
16
+ `FLUX.1 Layout Controlnet [dev]` is a ControlNet conditioned by a semantic image. The ControlNet is capable of generating an image based on a text description while following the semantic image. The Controlnet is applicable to [FLUX.1 [dev]](https://huggingface.co/black-forest-labs/FLUX.1-dev).
17
+
18
+ ## Showcase
19
+
20
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; justify-items: center;">
21
+
22
+ <div>
23
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6437c0ead38ce48bdd4b0067/1pQtOX6Dwzg3dIlCg2mag.png" width="100%" style="display: inline-block;" />
24
+ <br>
25
+ <p><i>This serene Chinese-inspired bedroom with a traditional bed frame featuring intricate carvings. Use soft, muted colors for the bedding and walls. Hang delicate, calligraphic artworks above the bed. Place a refined wooden nightstand with a circular mirror beside the bed and a built-in wardrobe with sliding doors. Large windows should be adorned with lightweight, embroidered curtains that allow natural light to gently enter the room on the wooden board.</i></p>
26
+ </div>
27
+
28
+ <div>
29
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6437c0ead38ce48bdd4b0067/MzcDCHKCKlBwGZeg-dZHl.png" width="100%" style="display: inline-block;" />
30
+ <br>
31
+ <p><i>This elegant European-style bedroom features a luxurious bed with a tufted headboard, adorned with fine linens. Incorporate classic abstract paintings above the bed and a sophisticated floating nightstand with a decorative mirror. Include a built-in wardrobe with ornate details and large windows draped with sheer, flowing curtains that let in soft, diffused light.</i></p>
32
+ </div>
33
+
34
+ <div>
35
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6437c0ead38ce48bdd4b0067/wrxvo9cNWq1otXixeK6gf.png" width="100%" style="display: inline-block;" />
36
+ <br>
37
+ <p><i>This whimsical cartoon bedroom with a playful bed that has a fun, tufted headboard. The bedding should feature bright, cheerful patterns. Hang colorful, abstract cartoons on the walls above the bed. Include a quirky, floating nightstand with a round, animated mirror and a built-in wardrobe with open shelves filled with toys. Large windows with sheer, patterned curtains should let in plenty of light, creating a lively atmosphere.</i></p>
38
+ </div>
39
+
40
+ <div>
41
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6437c0ead38ce48bdd4b0067/CHtrW7PRM0_wHDFmnnnYa.png" width="100%" style="display: inline-block;" />
42
+ <br>
43
+ <p><i>This futuristic cyberpunk bedroom with a sleek, high-tech bed featuring a digital display headboard. The bedding should have a metallic sheen with neon accents. Install holographic abstract art above the bed and a floating nightstand with a reflective, circular mirror. Add a built-in wardrobe with illuminated shelves and large windows with smart, translucent curtains that filter the city lights. The room should exude a cool, tech-savvy vibe.</i></p>
44
+ </div>
45
+
46
+ </div>
47
+
48
+ ## Diffusers
49
+
50
+ To use FLUX.1-Layout-Controlnet with the 🧨 diffusers python library, first install or upgrade `diffusers`, `peft`.
51
+
52
+ ```bash
53
+ pip install -U git+https://github.com/huggingface/diffusers
54
+ pip install -U peft
55
+ ```
56
+
57
+ Then you can use the `FluxControlNetPipeline` to run it:
58
+
59
+ ```python
60
+ import torch
61
+ from diffusers import FluxControlNetModel
62
+ from diffusers.pipelines import FluxControlNetPipeline
63
+ from diffusers.utils import load_image
64
+
65
+ generator = torch.Generator(device="cuda").manual_seed(87544357)
66
+
67
+ controlnet = FluxControlNetModel.from_pretrained(
68
+ "manycore-research/FLUX.1-Layout-ControlNet",
69
+ torch_dtype=torch.bfloat16,
70
+ )
71
+ pipe = FluxControlNetPipeline.from_pretrained(
72
+ "black-forest-labs/FLUX.1-dev/",
73
+ controlnet=controlnet,
74
+ torch_dtype=torch.bfloat16,
75
+ )
76
+ pipe.to("cuda")
77
+
78
+ control_image = load_image("https://huggingface.co/manycore-research/FLUX.1-Layout-ControlNet/blob/main/assets/input.png")
79
+ prompt = "This elegant European-style bedroom features a luxurious bed with a tufted headboard, adorned with fine linens. Incorporate classic abstract paintings above the bed and a sophisticated floating nightstand with a decorative mirror. Include a built-in wardrobe with ornate details and large windows draped with sheer, flowing curtains that let in soft, diffused light."
80
+
81
+ image = pipe(
82
+ prompt,
83
+ control_image=control_image,
84
+ controlnet_conditioning_scale=0.7,
85
+ num_inference_steps=25,
86
+ guidance_scale=7,
87
+ height=1024,
88
+ width=1024,
89
+ generator=generator,
90
+ num_images_per_prompt=1,
91
+ ).images[0]
92
+ image.save("output.png")
93
+ ```
94
+
95
+ ## LICENSE
96
+
97
+ FLUX.1-Layout-ControlNet is licensed under the [FLUX.1-dev Non-Commercial License](https://github.com/black-forest-labs/flux/blob/main/model_licenses/LICENSE-FLUX1-dev).
config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "FluxControlNetModel",
3
+ "_diffusers_version": "0.31.0",
4
+ "attention_head_dim": 128,
5
+ "axes_dims_rope": [
6
+ 16,
7
+ 56,
8
+ 56
9
+ ],
10
+ "guidance_embeds": true,
11
+ "in_channels": 64,
12
+ "joint_attention_dim": 4096,
13
+ "num_attention_heads": 24,
14
+ "conditioning_embedding_channels": 16,
15
+ "num_layers": 2,
16
+ "num_mode": null,
17
+ "num_single_layers": 0,
18
+ "patch_size": 2,
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:f4b998ab5b0b827125e626b13f2ed97f8491e9dbf18f42ea7cd6762f75f9759f
3
+ size 2975240576