mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-16 01:36:41 +08:00
Implemented EasyCache for aura_flow
This commit is contained in:
parent
e1b94339b7
commit
73ca950662
@ -9,6 +9,7 @@ import torch.nn.functional as F
|
|||||||
|
|
||||||
from comfy.ldm.modules.attention import optimized_attention
|
from comfy.ldm.modules.attention import optimized_attention
|
||||||
import comfy.ops
|
import comfy.ops
|
||||||
|
import comfy.patcher_extension
|
||||||
import comfy.ldm.common_dit
|
import comfy.ldm.common_dit
|
||||||
|
|
||||||
def modulate(x, shift, scale):
|
def modulate(x, shift, scale):
|
||||||
@ -436,6 +437,13 @@ class MMDiT(nn.Module):
|
|||||||
return x + pos_encoding.reshape(1, -1, self.positional_encoding.shape[-1])
|
return x + pos_encoding.reshape(1, -1, self.positional_encoding.shape[-1])
|
||||||
|
|
||||||
def forward(self, x, timestep, context, transformer_options={}, **kwargs):
|
def forward(self, x, timestep, context, 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, transformer_options, **kwargs)
|
||||||
|
|
||||||
|
def _forward(self, x, timestep, context, transformer_options={}, **kwargs):
|
||||||
patches_replace = transformer_options.get("patches_replace", {})
|
patches_replace = transformer_options.get("patches_replace", {})
|
||||||
# patchify x, add PE
|
# patchify x, add PE
|
||||||
b, c, h, w = x.shape
|
b, c, h, w = x.shape
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user