mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-12-23 04:50:49 +08:00
Add a temporary workaround for odd amount of blocks not producing expected results
This commit is contained in:
parent
0d8e8abd90
commit
831c3cf05e
@ -660,6 +660,12 @@ class ModelPatcher:
|
|||||||
continue
|
continue
|
||||||
# 2 blocks worth of VRAM may be needed for flipflop, so make sure to account for them.
|
# 2 blocks worth of VRAM may be needed for flipflop, so make sure to account for them.
|
||||||
flipflop_blocks = min((total_blocks - n_fit_in_memory) + 2, total_blocks)
|
flipflop_blocks = min((total_blocks - n_fit_in_memory) + 2, total_blocks)
|
||||||
|
# for now, work around odd number issue by making it even
|
||||||
|
if flipflop_blocks % 2 != 0:
|
||||||
|
if flipflop_blocks == total_blocks:
|
||||||
|
flipflop_blocks -= 1
|
||||||
|
else:
|
||||||
|
flipflop_blocks += 1
|
||||||
flipflop_blocks_per_type[block_type] = (flipflop_blocks, total_blocks)
|
flipflop_blocks_per_type[block_type] = (flipflop_blocks, total_blocks)
|
||||||
leftover_memory -= (total_blocks - flipflop_blocks + 2) * block_size
|
leftover_memory -= (total_blocks - flipflop_blocks + 2) * block_size
|
||||||
# if there are blocks to flipflop, need to mark their keys
|
# if there are blocks to flipflop, need to mark their keys
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user