File size: 5,023 Bytes
6e4996d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
license: other
license_name: flux-1-dev-non-commercial-license
license_link: >-
  https://github.com/black-forest-labs/flux/blob/main/model_licenses/LICENSE-FLUX1-dev
base_model:
- black-forest-labs/FLUX.1-dev
tags:
- image-generation
- flux
- controlnet
---

## FLUX.1-Layout-ControlNet

`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).

## Showcase

<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; justify-items: center;">
  
  <div>
    <img src="https://cdn-uploads.huggingface.co/production/uploads/6437c0ead38ce48bdd4b0067/1pQtOX6Dwzg3dIlCg2mag.png" width="100%" style="display: inline-block;" />
    <br>
    <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>
  </div>

  <div>
    <img src="https://cdn-uploads.huggingface.co/production/uploads/6437c0ead38ce48bdd4b0067/MzcDCHKCKlBwGZeg-dZHl.png" width="100%" style="display: inline-block;" />
    <br>
    <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>
  </div>

  <div>
    <img src="https://cdn-uploads.huggingface.co/production/uploads/6437c0ead38ce48bdd4b0067/wrxvo9cNWq1otXixeK6gf.png" width="100%" style="display: inline-block;" />
    <br>
    <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>
  </div>

  <div>
    <img src="https://cdn-uploads.huggingface.co/production/uploads/6437c0ead38ce48bdd4b0067/CHtrW7PRM0_wHDFmnnnYa.png" width="100%" style="display: inline-block;" />
    <br>
    <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>
  </div>

</div>

## Diffusers

To use FLUX.1-Layout-Controlnet with the 🧨 diffusers python library, first install or upgrade `diffusers`, `peft`.

```bash
pip install -U git+https://github.com/huggingface/diffusers
pip install -U peft
```

Then you can use the `FluxControlNetPipeline` to run it:

```python
import torch
from diffusers import FluxControlNetModel
from diffusers.pipelines import FluxControlNetPipeline
from diffusers.utils import load_image

generator = torch.Generator(device="cuda").manual_seed(87544357)

controlnet = FluxControlNetModel.from_pretrained(
  "manycore-research/FLUX.1-Layout-ControlNet",
  torch_dtype=torch.bfloat16,
)
pipe = FluxControlNetPipeline.from_pretrained(
  "black-forest-labs/FLUX.1-dev/",
  controlnet=controlnet,
  torch_dtype=torch.bfloat16,
)
pipe.to("cuda")

control_image = load_image("https://huggingface.co/manycore-research/FLUX.1-Layout-ControlNet/blob/main/assets/input.png")
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."

image = pipe(
    prompt,
    control_image=control_image,
    controlnet_conditioning_scale=0.7,
    num_inference_steps=25,
    guidance_scale=7,
    height=1024,
    width=1024,
    generator=generator,
    num_images_per_prompt=1,
).images[0]
image.save("output.png")
```

## LICENSE

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).