◀ 上一页
1 / 5
下一页 ▶
SD 1.5 + ControlNet Canny 宏观架构
从条件编码、完整 denoiser 到 VAE 解码;关键 shape 均取自 CN15-CANNY-FULL 的实测记录。
1. SD 1.5 + ControlNet Canny 宏观架构
从条件编码、完整 denoiser 到 VAE 解码;关键 shape 均取自 CN15-CANNY-FULL 的实测记录。
CN15-CANNY-FULL
Prompt
token IDs
CLIP-L
完整文本编码器
[1, 77, 768]
Noisy latent / tokens
batch = 1
[1, 4, 64, 64]
ControlNet Condition
Canny / latent condition
[1, 3, 512, 512]
UNet2DConditionModel
Control residual injection
完整生产层数,未折叠
[1, 4, 64, 64]
VAE Decoder
latent → pixels
[1, 3, 512, 512]
Final image
[1, 3, 512, 512]
ACTUAL-CUDA-FULL-TOPOLOGY
BF16 · NVIDIA A100-SXM4-40GB · native 512² · 1 shape-equivalent denoiser timestep
条件编码与分支组装
保留所有实际执行的文本与图像条件分支;输出 shape 与 merge 方式分别标注。
2. 条件编码与分支组装
保留所有实际执行的文本与图像条件分支;输出 shape 与 merge 方式分别标注。
CN15-CANNY-FULL
CLIP-L
Layers ×12
hidden 768 · heads 12
[1, 77, 768]
Prompt condition
cross-attention / joint-attention context
[1, 77, 768]
ControlNet Condition
Canny / latent condition
[1, 3, 512, 512]
ACTUAL-CUDA-FULL-TOPOLOGY
BF16 · NVIDIA A100-SXM4-40GB · native 512² · 1 shape-equivalent denoiser timestep
完整 U-Net 多尺度拓扑
Down / Mid / Up 全部生产层均执行;橙色虚线表示 skip connection,shape 为 batch 1。
3. 完整 U-Net 多尺度拓扑
Down / Mid / Up 全部生产层均执行;橙色虚线表示 skip connection,shape 为 batch 1。
CN15-CANNY-FULL
Down 0
ResNet×2
CrossAttn
320×64×64
Down 1
ResNet×2
CrossAttn
640×32×32
Down 2
ResNet×2
CrossAttn
1280×16×16
Down 3
ResNet×2
ResNet only
1280×8×8
Mid
ResNet
CrossAttn
1280×8×8
Up 0
ResNet×3
ResNet only
1280×8×8
Up 1
ResNet×3
CrossAttn
1280×16×16
Up 2
ResNet×3
CrossAttn
640×32×32
Up 3
ResNet×3
CrossAttn
320×64×64
skip 0: 320×64²
skip 1: 640×32²
skip 2: 1280×16²
skip 3: 1280×8²
input [1, 4, 64, 64]
output [1, 4, 64, 64]
Conv_in 4→320 · Conv_out 320→4 · layers_per_block=2
ACTUAL-CUDA-FULL-TOPOLOGY
BF16 · NVIDIA A100-SXM4-40GB · native 512² · 1 shape-equivalent denoiser timestep
核心算子与任务差异
ResNet、时间步注入、空间自注意力与文本交叉注意力;分支差异单独说明。
4. 核心算子与任务差异
ResNet、时间步注入、空间自注意力与文本交叉注意力;分支差异单独说明。
CN15-CANNY-FULL
ResnetBlock2D
GroupNorm + SiLU + Conv
Add time embedding
GroupNorm + Dropout + Conv
Residual / shortcut add
Transformer2DModel
Norm → Self Attention
Q=K=V=image tokens
Norm → Cross Attention
K=V=context [1, 77, 768]
Norm → GEGLU / MLP
residual after every sublayer
ControlNet residual 在对应 Down/Mid 特征级注入;不是额外输入通道拼接。
ACTUAL-CUDA-FULL-TOPOLOGY
BF16 · NVIDIA A100-SXM4-40GB · native 512² · 1 shape-equivalent denoiser timestep
VAE 边界与运行证据
VAE 仅把运行中真实执行的 Encode/Decode 标为 ACTUAL-CUDA;中间通道阶梯来自固定配置。
5. VAE 边界与运行证据
VAE 仅把运行中真实执行的 Encode/Decode 标为 ACTUAL-CUDA;中间通道阶梯来自固定配置。
CN15-CANNY-FULL
Denoised latent
actual denoiser output
[1, 4, 64, 64]
VAE Decoder
MidBlock + UpDecoder ×4
spatial upsample ×8
[1, 3, 512, 512]
Pixel output
native 512²
[1, 3, 512, 512]
STATIC-CONFIG 通道阶梯:512 → 512 → 256 → 128;latent_channels=4
Trace evidence
实例化参数合计
1.428B
峰值 CUDA allocated
2.39 GiB
行级 shape
4,434 rows / 43,394 hits
模块级 shape
1,239 rows / 1,267 hits
运行边界
native 512² · batch 1
随机初始化 BF16
结构/shape 学习证据;不代表生成质量
ACTUAL-CUDA-FULL-TOPOLOGY
BF16 · NVIDIA A100-SXM4-40GB · native 512² · 1 shape-equivalent denoiser timestep