refactor(ltx): rename temp_scheduler_opts to ltx_scheduler_opts

Per PR #4783 review; namespace the helper with the module.
This commit is contained in:
CalamitousFelicitousness
2026-04-21 02:13:09 +01:00
parent 7be6250b7a
commit f79e466183
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ from PIL import Image
from modules import shared, errors, timer, memstats, progress, processing, sd_models, sd_samplers, devices, extra_networks, call_queue
from modules.logger import log
from modules.ltx import ltx_capabilities
from modules.ltx.ltx_util import get_bucket, get_frames, load_model, load_upsample, load_upsample_2x, get_conditions, get_generator, get_prompts, temp_scheduler_opts, vae_decode
from modules.ltx.ltx_util import get_bucket, get_frames, load_model, load_upsample, load_upsample_2x, get_conditions, get_generator, get_prompts, ltx_scheduler_opts, vae_decode
from modules.processing_callbacks import diffusers_callback
from modules.video_models.video_vae import set_vae_params
from modules.video_models.video_save import save_video
@@ -290,10 +290,10 @@ def run_ltx(task_id,
framewise = caps.family == '0.9'
set_vae_params(p, framewise=framewise)
# Scheduler + shared.opts mutation is wrapped in temp_scheduler_opts so restore runs on
# Scheduler + shared.opts mutation is wrapped in ltx_scheduler_opts so restore runs on
# every exit path (normal return, abort, interrupt, Stage 2 scheduler swap). See the
# helper's docstring for the five pieces of state it snapshots.
with temp_scheduler_opts(shared.sd_model, dynamic_shift=dynamic_shift, sampler_shift=sampler_shift):
with ltx_scheduler_opts(shared.sd_model, dynamic_shift=dynamic_shift, sampler_shift=sampler_shift):
if selected is not None:
video_overrides.set_overrides(p, selected)
+1 -1
View File
@@ -82,7 +82,7 @@ def load_upsample_2x(upsample_pipe, upsample_repo_id):
@contextmanager
def temp_scheduler_opts(sd_model, *, dynamic_shift=None, sampler_shift=None):
def ltx_scheduler_opts(sd_model, *, dynamic_shift=None, sampler_shift=None):
# Run-scoped override of shared.opts scheduler settings and scheduler.config. Snapshots
# five pieces of state (shared.opts dynamic_shift + shift, scheduler object, default_scheduler
# snapshot, and scheduler.config use_dynamic_shifting + flow_shift) and restores every one on