mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-12-21 03:50:50 +08:00
Merge branch 'master' into dr-support-pip-cm
This commit is contained in:
commit
5582e2a0f3
@ -58,7 +58,8 @@ def is_odd(n: int) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def nonlinearity(x):
|
def nonlinearity(x):
|
||||||
return x * torch.sigmoid(x)
|
# x * sigmoid(x)
|
||||||
|
return torch.nn.functional.silu(x)
|
||||||
|
|
||||||
|
|
||||||
def Normalize(in_channels, num_groups=32):
|
def Normalize(in_channels, num_groups=32):
|
||||||
|
|||||||
@ -36,7 +36,7 @@ def get_timestep_embedding(timesteps, embedding_dim):
|
|||||||
|
|
||||||
def nonlinearity(x):
|
def nonlinearity(x):
|
||||||
# swish
|
# swish
|
||||||
return x*torch.sigmoid(x)
|
return torch.nn.functional.silu(x)
|
||||||
|
|
||||||
|
|
||||||
def Normalize(in_channels, num_groups=32):
|
def Normalize(in_channels, num_groups=32):
|
||||||
|
|||||||
@ -769,8 +769,7 @@ class CameraWanModel(WanModel):
|
|||||||
# embeddings
|
# embeddings
|
||||||
x = self.patch_embedding(x.float()).to(x.dtype)
|
x = self.patch_embedding(x.float()).to(x.dtype)
|
||||||
if self.control_adapter is not None and camera_conditions is not None:
|
if self.control_adapter is not None and camera_conditions is not None:
|
||||||
x_camera = self.control_adapter(camera_conditions).to(x.dtype)
|
x = x + self.control_adapter(camera_conditions).to(x.dtype)
|
||||||
x = x + x_camera
|
|
||||||
grid_sizes = x.shape[2:]
|
grid_sizes = x.shape[2:]
|
||||||
x = x.flatten(2).transpose(1, 2)
|
x = x.flatten(2).transpose(1, 2)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user