mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-30 00:00:26 +08:00
resblock fix
This commit is contained in:
parent
61b1efdaf0
commit
3f71760913
@ -357,6 +357,7 @@ class UNetDown(nn.Module):
|
|||||||
channels=hidden_channels,
|
channels=hidden_channels,
|
||||||
emb_channels=emb_channels,
|
emb_channels=emb_channels,
|
||||||
out_channels=out_channels,
|
out_channels=out_channels,
|
||||||
|
use_scale_shift_norm = True,
|
||||||
dropout=dropout,
|
dropout=dropout,
|
||||||
**factory_kwargs
|
**factory_kwargs
|
||||||
))
|
))
|
||||||
@ -365,6 +366,7 @@ class UNetDown(nn.Module):
|
|||||||
self.model.append(ResBlock(
|
self.model.append(ResBlock(
|
||||||
channels=hidden_channels,
|
channels=hidden_channels,
|
||||||
emb_channels=emb_channels,
|
emb_channels=emb_channels,
|
||||||
|
use_scale_shift_norm = True,
|
||||||
out_channels=hidden_channels if (i + 1) * 2 != self.patch_size else out_channels,
|
out_channels=hidden_channels if (i + 1) * 2 != self.patch_size else out_channels,
|
||||||
dropout=dropout,
|
dropout=dropout,
|
||||||
down=True,
|
down=True,
|
||||||
@ -401,6 +403,7 @@ class UNetUp(nn.Module):
|
|||||||
channels=in_channels,
|
channels=in_channels,
|
||||||
emb_channels=emb_channels,
|
emb_channels=emb_channels,
|
||||||
out_channels=hidden_channels,
|
out_channels=hidden_channels,
|
||||||
|
use_scale_shift_norm = True,
|
||||||
dropout=dropout,
|
dropout=dropout,
|
||||||
**factory_kwargs
|
**factory_kwargs
|
||||||
))
|
))
|
||||||
@ -410,6 +413,7 @@ class UNetUp(nn.Module):
|
|||||||
channels=in_channels if i == 0 else hidden_channels,
|
channels=in_channels if i == 0 else hidden_channels,
|
||||||
emb_channels=emb_channels,
|
emb_channels=emb_channels,
|
||||||
out_channels=hidden_channels,
|
out_channels=hidden_channels,
|
||||||
|
use_scale_shift_norm = True,
|
||||||
dropout=dropout,
|
dropout=dropout,
|
||||||
up=True,
|
up=True,
|
||||||
**factory_kwargs
|
**factory_kwargs
|
||||||
|
|||||||
@ -268,11 +268,7 @@ class ResBlock(TimestepBlock):
|
|||||||
if emb_out is not None:
|
if emb_out is not None:
|
||||||
if self.exchange_temb_dims:
|
if self.exchange_temb_dims:
|
||||||
emb_out = emb_out.movedim(1, 2)
|
emb_out = emb_out.movedim(1, 2)
|
||||||
try:
|
h = h + emb_out
|
||||||
h = h + emb_out
|
|
||||||
except:
|
|
||||||
emb_out = emb_out.movedim(1, 2)
|
|
||||||
h = h + emb_out
|
|
||||||
h = self.out_layers(h)
|
h = self.out_layers(h)
|
||||||
return self.skip_connection(x) + h
|
return self.skip_connection(x) + h
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user