Skip to content

Commit 61b08d4

Browse files
authored
Replace manual x * sigmoid(x) with torch silu in VAE nonlinearity (Comfy-Org#9057)
1 parent da9dab7 commit 61b08d4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

comfy/ldm/cosmos/cosmos_tokenizer/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def is_odd(n: int) -> bool:
5858

5959

6060
def nonlinearity(x):
61-
return x * torch.sigmoid(x)
61+
# x * sigmoid(x)
62+
return torch.nn.functional.silu(x)
6263

6364

6465
def Normalize(in_channels, num_groups=32):

comfy/ldm/modules/diffusionmodules/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_timestep_embedding(timesteps, embedding_dim):
3636

3737
def nonlinearity(x):
3838
# swish
39-
return x*torch.sigmoid(x)
39+
return torch.nn.functional.silu(x)
4040

4141

4242
def Normalize(in_channels, num_groups=32):

0 commit comments

Comments
 (0)