File size: 2,274 Bytes
7b35035
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
license: other
library_name: diffusers
pipeline_tag: text-to-image
tags:
  - stable-diffusion
  - stable-diffusion-xl
  - sdxl
  - text-to-image
  - diffusers
language:
  - zh
  - en
base_model: stabilityai/stable-diffusion-xl-base-1.0
---

# sen_v3 (diffusers format)

SDXL 1.0 架构文生图模型,`diffusers` 目录格式。

本仓库由单文件 checkpoint 转换而来,原始文件:[anhuanli/sen_v3](https://huggingface.co/anhuanli/sen_v3)

## 为什么有两个仓库

| 仓库 | 格式 | 适用场景 |
| --- | --- | --- |
| [anhuanli/sen_v3](https://huggingface.co/anhuanli/sen_v3) | 单文件 `.safetensors` | ComfyUI / WebUI / AI-Toolkit 填本地路径 |
| **anhuanli/sen_v3-diffusers**(本仓库) | diffusers 目录 | `from_pretrained()` / AI-Toolkit 填仓库名 / 在线推理 |

## 精度说明

转换时按源文件的原始精度逐组件保留,未做额外降精度:

| 组件 | 精度 | 参数量 |
| --- | --- | --- |
| `unet` | float16 | 2.567 B |
| `vae` | **float32** | 83.7 M |
| `text_encoder` (CLIP-L) | float16 | 123.1 M |
| `text_encoder_2` (OpenCLIP bigG) | float16 | 694.7 M |

> VAE 保持 fp32 是刻意的:SDXL 的 VAE 在 fp16 下容易数值溢出(黑图、NaN)。`vae.config.force_upcast` 已设为 `true`。
>
> 已逐张量比对验证:UNet / VAE / 文本编码器的权重与源文件 **maxdiff = 0.0**(完全一致)。

## 使用方法

```python
import torch
from diffusers import StableDiffusionXLPipeline

pipe = StableDiffusionXLPipeline.from_pretrained(
    "anhuanli/sen_v3-diffusers",
    torch_dtype=torch.float16,
).to("cuda")

image = pipe(
    prompt="a girl, soft light, detailed",
    num_inference_steps=28,
    guidance_scale=6.0,
    height=1024, width=1024,
).images[0]
image.save("out.png")
```

## AI-Toolkit 用法

训练 LoRA 时,在 **Name or Path** 直接填:

```
anhuanli/sen_v3-diffusers
```

## 模型来源与改动

- 基座:SDXL 1.0
- 微调方式 / 训练数据 / 触发词:**待补充**

## 限制与声明

- 生成内容由使用者自行负责,请遵守当地法律法规及平台条款。
- 训练数据未做完整审计,可能存在偏见或对特定风格/人物的过拟合。
- 商用前请自行核实基座模型(SDXL 1.0)的许可条款。