mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-12-18 02:23:06 +08:00
Fix improper index slicing for flipflop get blocks, add extra log message
This commit is contained in:
parent
7c896c5567
commit
0df61b5032
@ -33,7 +33,7 @@ class FlipFlopModule(torch.nn.Module):
|
||||
if block_type not in self.block_types:
|
||||
raise ValueError(f"Block type {block_type} not found in {self.block_types}")
|
||||
if block_type in self.flipflop:
|
||||
return getattr(self, block_type)[:self.flipflop[block_type].flip_amount]
|
||||
return getattr(self, block_type)[:self.flipflop[block_type].i_offset]
|
||||
return getattr(self, block_type)
|
||||
|
||||
def get_all_block_module_sizes(self, reverse_sort_by_size: bool = False) -> list[tuple[str, int]]:
|
||||
|
||||
@ -619,6 +619,7 @@ class ModelPatcher:
|
||||
def setup_flipflop(self, flipflop_blocks_per_type: dict[str, tuple[int, int]]):
|
||||
if not self.supports_flipflop():
|
||||
return
|
||||
logging.info(f"setting up flipflop with {flipflop_blocks_per_type}")
|
||||
self.model.diffusion_model.setup_flipflop_holders(flipflop_blocks_per_type, self.load_device, self.offload_device)
|
||||
|
||||
def init_flipflop_block_copies(self):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user