mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-15 22:56:49 +08:00
Added EasyCache support to hunyuan3d
This commit is contained in:
parent
ca5ad630cd
commit
d60e7a07cb
@ -7,6 +7,7 @@ from comfy.ldm.flux.layers import (
|
|||||||
SingleStreamBlock,
|
SingleStreamBlock,
|
||||||
timestep_embedding,
|
timestep_embedding,
|
||||||
)
|
)
|
||||||
|
import comfy.patcher_extension
|
||||||
|
|
||||||
|
|
||||||
class Hunyuan3Dv2(nn.Module):
|
class Hunyuan3Dv2(nn.Module):
|
||||||
@ -67,6 +68,13 @@ class Hunyuan3Dv2(nn.Module):
|
|||||||
self.final_layer = LastLayer(hidden_size, 1, in_channels, dtype=dtype, device=device, operations=operations)
|
self.final_layer = LastLayer(hidden_size, 1, in_channels, dtype=dtype, device=device, operations=operations)
|
||||||
|
|
||||||
def forward(self, x, timestep, context, guidance=None, transformer_options={}, **kwargs):
|
def forward(self, x, timestep, context, guidance=None, transformer_options={}, **kwargs):
|
||||||
|
return comfy.patcher_extension.WrapperExecutor.new_class_executor(
|
||||||
|
self._forward,
|
||||||
|
self,
|
||||||
|
comfy.patcher_extension.get_all_wrappers(comfy.patcher_extension.WrappersMP.DIFFUSION_MODEL, transformer_options)
|
||||||
|
).execute(x, timestep, context, guidance, transformer_options, **kwargs)
|
||||||
|
|
||||||
|
def _forward(self, x, timestep, context, guidance=None, transformer_options={}, **kwargs):
|
||||||
x = x.movedim(-1, -2)
|
x = x.movedim(-1, -2)
|
||||||
timestep = 1.0 - timestep
|
timestep = 1.0 - timestep
|
||||||
txt = context
|
txt = context
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user