Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 10 commits into from
Nov 23, 2024

Conversation

stduhpf
Copy link
Contributor

@stduhpf stduhpf commented Oct 29, 2024

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

CFG SLG
output normalcfg skiplayercfg
sampling time (30 steps) 73.46s 79.44s

@dsignarius
Copy link

Working nicely on amd igpu using vulkan and cpu

tried Q8_0 and fp16

fp16 model, vae and t5xxl:

keeper_126

@stduhpf stduhpf changed the title feat: add sd3.5 medium support feat: add sd3.5 medium support (+skiplayer guidance) Nov 4, 2024
@stduhpf stduhpf 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
Owner

leejet commented Nov 23, 2024

Thank you for your contribution.

@leejet leejet merged commit 65fa646 into leejet:master Nov 23, 2024
9 checks passed
@stduhpf stduhpf mentioned this pull request Dec 28, 2024
Sign up for free to 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