fix: impact_sampling - compatibility patch

https://github.com/comfyanonymous/ComfyUI/commit/1a0486bb96fb1ff10f4ea3c0d62eb815e9630585
This commit is contained in:
Dr.Lt.Data
2024-04-06 09:56:02 +09:00
parent a1694e5b04
commit 8d4e244165
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import configparser
import os
version_code = [4, 86]
version_code = [4, 86, 1]
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
dependency_version = 20
+5 -1
View File
@@ -13,7 +13,11 @@ def calculate_sigmas(model, sampler, scheduler, steps):
steps += 1
discard_penultimate_sigma = True
sigmas = samplers.calculate_sigmas_scheduler(model.model, scheduler, steps)
if hasattr(samplers, 'calculate_sigmas'):
sigmas = samplers.calculate_sigmas(model.get_model_object("model_sampling"), scheduler, steps)
else:
print(f"[Impact Pack] calculate_sigmas: ComfyUI is an outdated version.")
sigmas = samplers.calculate_sigmas_scheduler(model.model, scheduler, steps)
if discard_penultimate_sigma:
sigmas = torch.cat([sigmas[:-2], sigmas[-1:]])