🚀 图像生成模型:Flux-C4C-Design-LoRA
本项目是一个文本到图像的生成模型,借助LoRA技术,基于black-forest-labs/FLUX.1-dev
基础模型进行微调。它能依据特定提示词生成独特的图像,适用于艺术创作、设计等领域。
🚀 快速开始
环境搭建
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "strangerzonehf/Flux-C4C-Design-LoRA"
trigger_word = "Smiley C4C"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
触发词使用
你需要使用Smiley C4C
来触发图像生成。
模型下载
该模型的权重以Safetensors格式提供。
点击下载,可在Files & versions选项卡中获取。
✨ 主要特性
- 文本到图像生成:根据输入的文本提示生成对应的图像。
- LoRA微调:基于基础模型进行高效微调,提升特定场景的生成效果。
- 多场景适用:适用于艺术创作、设计等多个领域。
📦 安装指南
安装所需依赖库:
import torch
from pipelines import DiffusionPipeline
💻 使用示例
基础用法
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "strangerzonehf/Flux-C4C-Design-LoRA"
trigger_word = "Smiley C4C"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
prompt = f"{trigger_word}, a close-up of a persons head is visible. The person is wearing a gray sweater, adorned with a silver chain around their neck, and a silver helmet on their head. The helmet is adorned with two cork-like objects, each with a light shining on it, adding a touch of warmth to the scene. The background is a dark blue, creating a stark contrast to the silver helmet."
image = pipe(prompt).images[0]
image.save("output.png")
📚 详细文档
图像生成示例
输入文本 |
输出图像 |
Smiley C4C, a close-up of a persons head is visible. The person is wearing a gray sweater, adorned with a silver chain around their neck, and a silver helmet on their head. The helmet is adorned with two cork-like objects, each with a light shining on it, adding a touch of warmth to the scene. The background is a dark blue, creating a stark contrast to the silver helmet. |
点击查看 |
Smiley C4C, a cartoon character is seen wearing a black t-shirt with an orange and yellow graphic on the front. The character is wearing a helmet that is shaped like a face, with two small round objects sticking out of the helmet. The helmet is adorned with two circular objects on top of it, one of which is a light brown color and the other is a darker brown color. The background is a dark brown. |
点击查看 |
Smiley C4C, Captured from a low-angle perspective on a vibrant blue backdrop, a man dressed in a white Adidas t-shirt, adorned with a bright yellow helmet and goggles. The helmet is adorned with two white knobs on the top of the helmet, adding a pop of color to the scene. The mans shirt is adorned in a blue collar with a blue adidas logo and a green tennis racket hanging from the bottom right corner of the frame. |
点击查看 |
Smiley C4C, Captured from a low-angle perspective on a vibrant blue backdrop, a vibrant yellow helmet adorned with a smiley face and a gold chain around the eyes. The helmet is adorned with two handles on either side of the helmet, adorned with gold chains, adding a pop of color to the otherwise monochromatic scene. The shirt below the helmet is a plain yellow t-shirt adorned with the word "Smile" in bold white letters. |
点击查看 |
图像生成参数
属性 |
详情 |
基础模型 |
black-forest-labs/FLUX.1-dev |
实例提示词 |
Smiley C4C |
标签方式 |
florence2-en(自然语言 & 英语) |
训练使用的总图像数 |
14 |
LR调度器 |
constant |
噪声偏移 |
0.03 |
优化器 |
AdamW |
多分辨率噪声折扣 |
0.1 |
网络维度 |
64 |
多分辨率噪声迭代次数 |
10 |
重复次数 & 步数 |
25 & 3100 |
训练轮数 |
15 |
每N轮保存一次 |
1 |
最佳尺寸与推理
尺寸 |
长宽比 |
推荐情况 |
1280 x 832 |
3:2 |
最佳 |
1024 x 1024 |
1:1 |
默认 |
推理范围
📄 许可证
本模型采用creativeml-openrail-m
许可证。