Downloads · 30 days
560
2% of all-time downloads
jasperai/Flux.1-dev-Controlnet-Surface-Normals
Flux.1-dev-Controlnet-Surface-Normals is a image-to-image model from jasperai. Use it when you need one image transformed into another. It is set up for diffusers. The card lists the license as other.
This is Flux.1-dev ControlNet for Surface Normals map developed by Jasper research team.
Downloads · 30 days
560
2% of all-time downloads
All-time downloads
26.1K
Public
Parameters
1.8B
10.7 GB on disk
Likes
101
Public
Click a slice to open those files.
.safetensors3.6 GB · 100%
From the Hugging Face model README
This is Flux.1-dev ControlNet for Surface Normals map developed by Jasper research team.
<p align="center"> <img style="width:700px;" src="examples/showcase.jpg"> </p>This model can be used directly with the diffusers library
import torch
from diffusers.utils import load_image
from diffusers import FluxControlNetModel
from diffusers.pipelines import FluxControlNetPipeline
# Load pipeline
controlnet = FluxControlNetModel.from_pretrained(
"jasperai/Flux.1-dev-Controlnet-Surface-Normals",
torch_dtype=torch.bfloat16
)
pipe = FluxControlNetPipeline.from_pretrained(
"black-forest-labs/FLUX.1-dev",
controlnet=controlnet,
torch_dtype=torch.bfloat16
)
pipe.to("cuda")
# Load a control image
control_image = load_image(
"https://huggingface.co/jasperai/Flux.1-dev-Controlnet-Surface-Normals/resolve/main/examples/surface.jpg"
)
prompt = "a man showing stop sign in front of window"
image = pipe(
prompt,
control_image=control_image,
controlnet_conditioning_scale=0.6,
num_inference_steps=28,
guidance_scale=3.5,
height=control_image.size[1],
width=control_image.size[0]
).images[0]
image
<p align="center">
<img style="width:500px;" src="examples/output.jpg">
</p>
💡 Note: You can compute the conditioning map using the NormalBaeDetector from the controlnet_aux library
from controlnet_aux import NormalBaeDetector
from diffusers.utils import load_image
normal_bae = NormalBaeDetector.from_pretrained("lllyasviel/Annotators")
normal_bae.to("cuda")
# Load an image
im = load_image(
"https://huggingface.co/jasperai/Flux.1-dev-Controlnet-Surface-Normals/resolve/main/examples/output.jpg"
)
surface = normal_bae(im)
This model was trained with surface normals maps computed with Clipdrop's surface normals estimator model as well as an open-souce surface normals estimation model such as Boundary Aware Encoder (BAE).
This model falls under the Flux.1-dev model licence.