MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / get_up_block_adapter

Function get_up_block_adapter

diffusers/src/diffusers/models/controlnet_xs.py:231–242  ·  view source on GitHub ↗
(
    out_channels: int,
    prev_output_channel: int,
    ctrl_skip_channels: List[int],
)

Source from the content-addressed store, hash-verified

229
230
231def get_up_block_adapter(
232 out_channels: int,
233 prev_output_channel: int,
234 ctrl_skip_channels: List[int],
235):
236 ctrl_to_base = []
237 num_layers = 3 # only support sd + sdxl
238 for i in range(num_layers):
239 resnet_in_channels = prev_output_channel if i == 0 else out_channels
240 ctrl_to_base.append(make_zero_conv(ctrl_skip_channels[i], resnet_in_channels))
241
242 return UpBlockControlNetXSAdapter(ctrl_to_base=nn.ModuleList(ctrl_to_base))
243
244
245class ControlNetXSAdapter(ModelMixin, ConfigMixin):

Callers 1

__init__Method · 0.85

Calls 2

make_zero_convFunction · 0.85

Tested by

no test coverage detected