Skip to content

Commit

Permalink
hack: disable optimizations for n_iter > 1
Browse files Browse the repository at this point in the history
This has the practical side effect of a substantial speed increase for high vram cards, while potentially slowing doing inference for n_iter values greater than one.

See jug-dev/ComfyUI#1
  • Loading branch information
tazlin committed May 7, 2023
1 parent 49bc2d5 commit 89c4aac
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion hordelib/install_comfy.patch
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ index c809d39..9c9f6b8 100644
+ # logger.warning(f"Done DPM-Solver++(2M) on model {id(model):x}")
return x
diff --git a/comfy/model_management.py b/comfy/model_management.py
index a0d1313..38650be 100644
index a0d1313..05ba193 100644
--- a/comfy/model_management.py
+++ b/comfy/model_management.py
@@ -1,6 +1,9 @@
Expand Down Expand Up @@ -327,6 +327,15 @@ index a0d1313..38650be 100644


def load_if_low_vram(model):
@@ -272,6 +358,8 @@ def get_free_memory(dev=None, torch_free_too=False):
return mem_free_total

def maximum_batch_area():
+ return 0
+ # See https://github.com/jug-dev/hordelib/issues/225
global vram_state
if vram_state == VRAMState.NO_VRAM:
return 0
diff --git a/comfy/samplers.py b/comfy/samplers.py
index 1552722..0ac5903 100644
--- a/comfy/samplers.py
Expand Down

0 comments on commit 89c4aac

Please sign in to comment.