refactor(settings): reorganize the offload settings by mode

The offload section interleaved shared and mode-specific options. The
page now reads top down: general options, an Offload Overrides section
holding the exclusions shared by balanced and group offload, then one
tuning section per mode. Use torch streams becomes Prefetch with streams
and Record torch streams becomes Overlap stream transfers, the section
headers carry hints, and the hints reflect live behavior, including
dropping the model-reload badge from options that apply on change.
This commit is contained in:
CalamitousFelicitousness
2026-08-14 23:59:55 +01:00
parent 3a17992060
commit 09eeff30c7
3 changed files with 19 additions and 16 deletions
+6 -5
View File
@@ -138,19 +138,20 @@ def create_settings(cmd_opts):
"offload_sep": OptionInfo("<h2>Model Offloading</h2>", "", gr.HTML),
"diffusers_offload_mode": OptionInfo(startup_offload_mode, "Model offload mode", gr.Radio, {"choices": ['none', 'balanced', 'group', 'model', 'sequential']}),
"diffusers_offload_nonblocking": OptionInfo(False, "Non-blocking move operations"),
"offload_overrides_sep": OptionInfo("<h2>Offload Overrides</h2>", "", gr.HTML),
"models_not_to_offload": OptionInfo("", "Model types not to offload"),
"diffusers_offload_always": OptionInfo(startup_offload_always, "Modules to always offload"),
"diffusers_offload_never": OptionInfo(startup_offload_never, "Modules to never offload"),
"offload_balanced_sep": OptionInfo("<h2>Balanced Offload</h2>", "", gr.HTML),
"diffusers_offload_pre": OptionInfo(True, "Offload during pre-forward", gr.Checkbox, {"visible": False}),
"diffusers_offload_streams": OptionInfo(False, "Offload using streams"),
"diffusers_offload_min_gpu_memory": OptionInfo(startup_offload_min_gpu, "Offload low watermark", gr.Slider, {"minimum": 0, "maximum": 1, "step": 0.01 }),
"diffusers_offload_max_gpu_memory": OptionInfo(startup_offload_max_gpu, "Offload GPU high watermark", gr.Slider, {"minimum": 0.1, "maximum": 1, "step": 0.01 }),
"diffusers_offload_max_cpu_memory": OptionInfo(0.90, "Offload CPU high watermark", gr.Slider, {"minimum": 0, "maximum": 1, "step": 0.01, "visible": False }),
"models_not_to_offload": OptionInfo("", "Model types not to offload"),
"diffusers_offload_always": OptionInfo(startup_offload_always, "Modules to always offload"),
"diffusers_offload_never": OptionInfo(startup_offload_never, "Modules to never offload"),
"offload_group_sep": OptionInfo("<h2>Group Offload</h2>", "", gr.HTML),
"group_offload_type": OptionInfo("leaf_level", "Group offload type", gr.Radio, {"choices": ['leaf_level', 'block_level']}),
"group_offload_stream": OptionInfo(False, "Use torch streams", gr.Checkbox),
'group_offload_record': OptionInfo(False, "Record torch streams", gr.Checkbox),
"group_offload_stream": OptionInfo(False, "Prefetch with streams", gr.Checkbox),
'group_offload_record': OptionInfo(False, "Overlap stream transfers", gr.Checkbox),
'group_offload_pin': OptionInfo(True, "Pin offload memory", gr.Checkbox),
'group_offload_blocks': OptionInfo(1, "Offload blocks", gr.Number),
"caption_offload_sep": OptionInfo("<h2>Caption Model Offloading</h2>", "", gr.HTML),