Skip to content

Commit

Permalink
fix: impact_sampling - compatibility patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ltdrdata committed Apr 6, 2024
1 parent a1694e5 commit 8d4e244
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/impact/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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
Expand Down
6 changes: 5 additions & 1 deletion modules/impact/impact_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:]])
Expand Down

0 comments on commit 8d4e244

Please sign in to comment.