Skip to content

vllm_omni.diffusion.models.hunyuan_image3.layers.common.utils

Small platform-agnostic helpers for UNet-style blocks (adapted from diffusers).

conv_nd / normalization / linear / zero_module are used by the ResBlock / UNetDown / UNetUp implementations across HunyuanImage3's platform-specific layer packages. They are plain nn.ConvNd / nn.GroupNorm / nn.Linear wrappers with no hardware-specific behaviour, so they live here instead of being duplicated per backend.

conv_nd

conv_nd(dims, *args, **kwargs)

Create a 1D, 2D, or 3D convolution module.

linear

linear(*args, **kwargs)

Create a linear module.

normalization

normalization(channels, **kwargs)

Make a standard normalization layer. :param channels: number of input channels. :return: a nn.Module for normalization.

zero_module

zero_module(module)

Zero out the parameters of a module and return it.