SpatialGen
Collection
Layout-guided 3D Indoor Scene Generation • 5 items • Updated • 3
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("manycore-research/FLUX.1-Wireframe-dev-lora")
prompt = "A modern living room features a clean and minimalist design. On the left, a light beige wall houses a built-in shelving unit with a textured, neutral finish, adorned with a few decorative items. The right wall showcases a ribbed, light gray panel with a built-in storage unit below. The floor is covered with a light beige carpet, which extends into the midground where a beige sofa with patterned throw pillows is positioned. A small round ottoman sits in front of the sofa, adding a cozy touch. In the background, large windows with sheer curtains allow natural light to flood the room, highlighting the light gray curtains and the greenery outside. A tall, narrow plant stand with a potted plant stands beside the window, adding a touch of nature. The ceiling features a circular chandelier with a modern design, casting a warm glow over the space."
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
image = pipe(image=input_image, prompt=prompt).images[0]FLUX.1 Wireframe [dev] LoRA is an improved version of FLUX.1-Layout-ControlNet, which serves as a key component of the SpatialGen. FLUX.1 Wireframe [dev] LoRA is a LoRA for FLUX.1 [dev], capable of generating an image based on a text description while following the structure of the given wireframe image.




import torch
from diffusers.pipelines.flux.pipeline_flux_control import FluxControlPipeline
from diffusers.utils import load_image
pipe = FluxControlPipeline.from_pretrained(
"black-forest-labs/FLUX.1-dev",
torch_dtype=torch.bfloat16,
)
pipe.load_lora_weights("manycore-research/FLUX.1-Wireframe-dev-lora")
pipe = pipe.to("cuda")
control_image = load_image(
"https://huggingface.co/manycore-research/FLUX.1-Wireframe-dev-lora/resolve/main/assets/input1.png"
)
prompt = "A modern living room features a clean and minimalist design. On the left, a light beige wall houses a built-in shelving unit with a textured, neutral finish, adorned with a few decorative items. The right wall showcases a ribbed, light gray panel with a built-in storage unit below. The floor is covered with a light beige carpet, which extends into the midground where a beige sofa with patterned throw pillows is positioned. A small round ottoman sits in front of the sofa, adding a cozy touch. In the background, large windows with sheer curtains allow natural light to flood the room, highlighting the light gray curtains and the greenery outside. A tall, narrow plant stand with a potted plant stands beside the window, adding a touch of nature. The ceiling features a circular chandelier with a modern design, casting a warm glow over the space."
image = pipe(
prompt=prompt,
control_image=control_image,
num_inference_steps=20,
generator=torch.Generator(device="cpu").manual_seed(42),
height=512,
width=512,
guidance_scale=10.0,
).images[0]
image.save("output.png")
FLUX.1-Wireframe-dev-lora is licensed under the FLUX.1-dev Non-Commercial License.
Base model
black-forest-labs/FLUX.1-dev