Skip to content

feat: add sd3.5 medium support (+skip layer guidance) - #451

Merged
leejet merged 10 commits into
leejet:masterfrom
stduhpf:sd3.5-medium
Nov 23, 2024
Merged

feat: add sd3.5 medium support (+skip layer guidance)#451
leejet merged 10 commits into
leejet:masterfrom
stduhpf:sd3.5-medium

Conversation

@stduhpf

@stduhpfstduhpf commented Oct 29, 2024

Copy link
Copy Markdown
Contributor

Closes#450

How to Use

Download weights

Run

SD3.5 Medium

For example:

.\bin\Release\sd.exe -m ..\models\sd3.5_medium.safetensors --clip_l ..\models\clip_l.safetensors --clip_g ..\models\clip_g.safetensors --t5xxl ..\models\t5xxl_fp16.safetensors -H 1024 -W 1024 -p 'a lovely cat holding a sign says \"Stable diffusion 3.5 Medium\"' --cfg-scale 4.5 --sampling-method euler -v

output

Skip Layer Guidance (SLG)

Variant of Classifier-Free Guidance (CFG) that seems to improve SD3.5 medium's output quality quite significantly (especially anatomy and hands for example), at the cost of slower inference speed (some steps require 3 evals of the model instead of 2).

> sd.exe --model ..\models\sd3.5_medium-q8_0.gguf --clip_l ..\models\clip\clip_l.safetensors --clip_g ..\models\clip\clip_g.safetensors --t5xxl ..\models\clip\t5xxl_q4_k.gguf -p 'A cute anime girl waving at the camera.' --cfg-scale 4.5 --sampling-method euler --steps 30 -t 24 --vae-tiling -W 512 -H 768 --seed 42
vs
> sd.exe --model ..\models\sd3.5_medium-q8_0.gguf --clip_l ..\models\clip\clip_l.safetensors --clip_g ..\models\clip\clip_g.safetensors --t5xxl ..\models\clip\t5xxl_q4_k.gguf -p 'A cute anime girl waving at the camera.' --cfg-scale 4.5 --sampling-method euler --steps 30 -t 24 --vae-tiling -W 512 -H 768 --seed 42 --slg-scale 2.5

CFGSLG
outputnormalcfgskiplayercfg
sampling time (30 steps)73.46s79.44s

@dsignarius

Copy link
Copy Markdown

Working nicely on amd igpu using vulkan and cpu

tried Q8_0 and fp16

fp16 model, vae and t5xxl:

keeper_126

@stduhpfstduhpf changed the title feat: add sd3.5 medium supportfeat: add sd3.5 medium support (+skiplayer guidance)Nov 4, 2024
@stduhpfstduhpf changed the title feat: add sd3.5 medium support (+skiplayer guidance)feat: add sd3.5 medium support (+skip layer guidance)Nov 4, 2024
@leejet

Copy link
Copy Markdown
Owner

Thank you for your contribution.

@leejet
leejet merged commit 65fa646 into leejet:masterNov 23, 2024
@stduhpfstduhpf mentioned this pull request Dec 28, 2024
@stduhpf
stduhpf deleted the sd3.5-medium branch June 14, 2026 21:15
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new architecture: 3.5 medium

3 participants

@stduhpf@dsignarius@leejet