许可证: 其他
基础模型: "stabilityai/stable-diffusion-3.5-large"
标签:
- sd3
- sd3-diffusers
- 文本生成图像
- 图像生成图像
- diffusers
- simpletuner
- 非全年龄向
- lora
- 模板:sd-lora
- 标准
管道标签: 文本生成图像
推理: 是
小部件:
- 文本: '无条件(空白提示)'
参数:
负面提示: '模糊, 裁剪, 丑陋'
输出:
链接: ./assets/image_0_0.png
- 文本: '适合丝网印刷工艺的图像。'
参数:
负面提示: '模糊, 裁剪, 丑陋'
输出:
链接: ./assets/image_1_0.png
simpletuner-lora-screenprinting
这是一个标准的PEFT LoRA模型,基于stabilityai/stable-diffusion-3.5-large训练而成。
训练过程中使用的主要验证提示为:
适合丝网印刷工艺的图像。
验证设置
- CFG:
5.0
- CFG重缩放:
0.0
- 步数:
20
- 采样器:
FlowMatchEulerDiscreteScheduler
- 种子:
42
- 分辨率:
512x512
- 跳过层引导:
注意:验证设置不一定与训练设置相同。
你可以在以下图库中找到一些示例图像:
文本编码器未进行训练。
你可以复用基础模型的文本编码器进行推理。
训练设置
数据集
my-dataset-512
- 重复次数: 10
- 总图像数: 735
- 总宽高比分桶数: 1
- 分辨率: 0.262144百万像素
- 裁剪: 否
- 裁剪风格: 无
- 裁剪宽高比: 无
- 用于正则化数据: 否
my-dataset-crop-512
- 重复次数: 10
- 总图像数: 732
- 总宽高比分桶数: 1
- 分辨率: 0.262144百万像素
- 裁剪: 是
- 裁剪风格: 居中
- 裁剪宽高比: 正方形
- 用于正则化数据: 否
推理
import torch
from diffusers import DiffusionPipeline
model_id = 'stabilityai/stable-diffusion-3.5-large'
adapter_id = 'DovahChikiin72/simpletuner-lora-screenprinting'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipeline.load_lora_weights(adapter_id)
prompt = "适合丝网印刷工艺的图像。"
negative_prompt = '模糊, 裁剪, 丑陋'
from optimum.quanto import quantize, freeze, qint8
quantize(pipeline.transformer, weights=qint8)
freeze(pipeline.transformer)
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
model_output = pipeline(
prompt=prompt,
negative_prompt=negative_prompt,
num_inference_steps=20,
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
width=512,
height=512,
guidance_scale=5.0,
).images[0]
model_output.save("output.png", format="PNG")