mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user