mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-11 00:47:14 +08:00
Fix cast issue.
This commit is contained in:
parent
e06033fb97
commit
d3f5ae56b3
@ -22,6 +22,7 @@ from comfy.ldm.seedvr.constants import (
|
|||||||
SEEDVR2_ROPE_PARTIAL_CHUNK_TOKENS,
|
SEEDVR2_ROPE_PARTIAL_CHUNK_TOKENS,
|
||||||
)
|
)
|
||||||
import comfy.model_management
|
import comfy.model_management
|
||||||
|
import comfy.ops
|
||||||
|
|
||||||
class Cache:
|
class Cache:
|
||||||
def __init__(self, disable=False, prefix="", cache=None):
|
def __init__(self, disable=False, prefix="", cache=None):
|
||||||
@ -1041,9 +1042,12 @@ class AdaSingle(nn.Module):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if mode == "in":
|
if mode == "in":
|
||||||
|
shiftB = comfy.ops.cast_to_input(shiftB, hid)
|
||||||
|
scaleB = comfy.ops.cast_to_input(scaleB, hid)
|
||||||
return hid.mul_(scaleA + scaleB).add_(shiftA + shiftB)
|
return hid.mul_(scaleA + scaleB).add_(shiftA + shiftB)
|
||||||
if mode == "out":
|
if mode == "out":
|
||||||
if gateB is not None:
|
if gateB is not None:
|
||||||
|
gateB = comfy.ops.cast_to_input(gateB, hid)
|
||||||
return hid.mul_(gateA + gateB)
|
return hid.mul_(gateA + gateB)
|
||||||
else:
|
else:
|
||||||
return hid.mul_(gateA)
|
return hid.mul_(gateA)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user