🚀 ⚡ 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 |