基础模型:
- black-forest-labs/FLUX.1-dev
库名称: diffusers
许可证类型: 其他
许可证名称: flux-1-dev-non-commercial-license
许可证链接: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
管道标签: 图像转图像
推理: 禁用
标签:
- ControlNet
⚡ Flux.1-dev: 深度控制网 ⚡
这是由Jasper研究团队开发的Flux.1-dev深度图控制网模型。
使用方法
本模型可直接与diffusers
库配合使用
import torch
from diffusers.utils import load_image
from diffusers import FluxControlNetModel
from diffusers.pipelines import FluxControlNetPipeline
controlnet = FluxControlNetModel.from_pretrained(
"jasperai/Flux.1-dev-Controlnet-Depth",
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/jasperai/Flux.1-dev-Controlnet-Depth/resolve/main/examples/depth.jpg"
)
prompt = "紫色郁金香花田中地精雕像的图像"
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
💡 提示:您可以使用controlnet_aux
库中的MidasDetector
来计算条件映射
from controlnet_aux import MidasDetector
from diffusers.utils import load_image
midas = MidasDetector.from_pretrained("lllyasviel/Annotators")
midas.to("cuda")
im = load_image(
"https://huggingface.co/jasperai/Flux.1-dev-Controlnet-Depth/resolve/main/examples/output.jpg"
)
depth = midas(im)
训练过程
本模型使用Clipdrop深度估计模型以及Midas、Leres等开源深度估计模型生成的深度图进行训练。
许可证
本模型遵循Flux.1-dev许可证条款。