Skip to content

Commit 7899261

Browse files
authored
fix: turbo scheduler loading issue (#3065)
* fix: correctly load ModelPatcher * feat: do not load model at all, not needed
1 parent 3ef663c commit 7899261

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ldm_patched/contrib/external_custom_sampler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ def INPUT_TYPES(s):
107107
def get_sigmas(self, model, steps, denoise):
108108
start_step = 10 - int(10 * denoise)
109109
timesteps = torch.flip(torch.arange(1, 11) * 100 - 1, (0,))[start_step:start_step + steps]
110-
ldm_patched.modules.model_management.load_models_gpu([model])
111-
sigmas = model.model.model_sampling.sigma(timesteps)
110+
sigmas = model.model_sampling.sigma(timesteps)
112111
sigmas = torch.cat([sigmas, sigmas.new_zeros([1])])
113112
return (sigmas, )
114113

modules/sample_hijack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def calculate_sigmas_scheduler_hacked(model, scheduler_name, steps):
175175
elif scheduler_name == "sgm_uniform":
176176
sigmas = normal_scheduler(model, steps, sgm=True)
177177
elif scheduler_name == "turbo":
178-
sigmas = SDTurboScheduler().get_sigmas(namedtuple('Patcher', ['model'])(model=model), steps=steps, denoise=1.0)[0]
178+
sigmas = SDTurboScheduler().get_sigmas(model=model, steps=steps, denoise=1.0)[0]
179179
elif scheduler_name == "align_your_steps":
180180
model_type = 'SDXL' if isinstance(model.latent_format, ldm_patched.modules.latent_formats.SDXL) else 'SD1'
181181
sigmas = AlignYourStepsScheduler().get_sigmas(model_type=model_type, steps=steps, denoise=1.0)[0]

0 commit comments

Comments
 (0)