Skip to content

[Stable Diffusion] Add the three main performance options as exposed toggles - #2843

Open
NineBallo wants to merge 2 commits into
lemonade-sdk:mainfrom
NineBallo:add-sd-perf-options
Open

[Stable Diffusion] Add the three main performance options as exposed toggles#2843
NineBallo wants to merge 2 commits into
lemonade-sdk:mainfrom
NineBallo:add-sd-perf-options

Conversation

@NineBallo

@NineBallo NineBallo commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This adds the three main performance toggles to the webui.
--diffusion-fa, --diffusion-conv-direct, and --vae-conv-direct

---- AI Description
It respects that vulkan & cuda has fa forced and locks that one when they are set.

Add three new boolean configuration options for the sd-cpp backend that control GPU compute features:

  • Diffusion FA (--diffusion-fa) — Enable fused-attention
  • Diffusion Conv Direct (--diffusion-conv-direct) — Enable direct convolution
  • VAE Conv Direct (--vae-conv-direct) — Enable VAE direct convolution

Key Features:

  1. Generic backend descriptor — Options are defined in sdcpp.h descriptor. New boolean options automatically become CLI flags without code changes in the server merge function.

  2. Backend-forced flags — Vulkan and CUDA backends require --diffusion-fa. The server enforces this: if the user unchecks the box, the flag still gets added to sdcpp_args.

  3. UI disabled checkboxes — When a backend forces an option (e.g., Vulkan forces Diffusion FA), the checkbox is disabled with a 🔒 lock icon and tooltip explaining "This option is required by the
    selected backend".

  4. recipe_options API — The new options are exposed in GET /api/v1/models//recipe_options so the frontend can check force_* fields.

Files Changed:

  • src/cpp/include/lemon/backends/sdcpp/sdcpp.h — Add options to descriptor
  • src/cpp/server/server.cpp — Generic build_sdcpp_args_merge() function with forced-flag logic
  • src/app/src/renderer/ModelOptionsModal.tsx — Disabled checkbox UI with lock icon
  • src/app/src/renderer/recipes/recipeOptionsConfig.ts — Frontend option mappings
  • src/app/styles/styles.css — Disabled checkbox + locked indicator styles

@github-actions github-actions Bot added engine::sd stable-diffusion.cpp backend; image generation/edit/variations enhancement New feature or request labels Jul 29, 2026
@NineBallo
NineBallo marked this pull request as ready for review July 29, 2026 04:48
@jeremyfowers

Copy link
Copy Markdown
Member

@NineBallo please be aware that we have a feature freeze on gui2, and the gui changes will need to go into GUI3. If you can remove the gui features from this PR and rebase them into gui3 in a future PR that would be great.

@jeremyfowers jeremyfowers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine::sd stable-diffusion.cpp backend; image generation/edit/variations enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants