🚀 ⚡ Flux.1-dev: 超分辨率ControlNet ⚡
这是由Jasper研究团队开发的适用于低分辨率图像的 Flux.1-dev ControlNet模型。它能够有效处理低分辨率图像,实现超分辨率等功能,为图像生成领域带来新的解决方案。
🚀 快速开始
本模型可直接与 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-Upscaler",
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-Upscaler/resolve/main/examples/input.jpg"
)
w, h = control_image.size
control_image = control_image.resize((w * 4, h * 4))
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
🔧 技术细节
本模型采用了一种合成的复杂数据退化方案进行训练。该方案以一张真实场景图像作为输入,通过结合多种退化方式(如高斯噪声、泊松噪声、图像模糊和JPEG压缩等)对图像进行人工退化,其思路与文献 [1] 类似。
[1] Wang, Xintao, et al. "Real-esrgan: Training real-world blind super-resolution with pure synthetic data." Proceedings of the IEEE/CVF international conference on computer vision. 2021.
📄 许可证
本模型遵循 Flux.1-dev 模型许可证。
📦 模型信息
属性 |
详情 |
基础模型 |
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、超分辨率、图像上采样、文本到图像、Stable Diffusion、LoRA、Diffusers、FluxPipeline |