bridge.diffusion.models.wan.inference.utils#

Module Contents#

Functions#

rand_name

cache_video

cache_image

str2bool

Convert a string to a boolean.

Data#

API#

bridge.diffusion.models.wan.inference.utils.__all__#

[‘cache_video’, ‘cache_image’, ‘str2bool’]

bridge.diffusion.models.wan.inference.utils.rand_name(length=8, suffix='')#
bridge.diffusion.models.wan.inference.utils.cache_video(
tensor,
save_file=None,
fps=30,
suffix='.mp4',
nrow=8,
normalize=True,
value_range=(-1, 1),
retry=5,
)#
bridge.diffusion.models.wan.inference.utils.cache_image(
tensor,
save_file,
nrow=8,
normalize=True,
value_range=(-1, 1),
retry=5,
)#
bridge.diffusion.models.wan.inference.utils.str2bool(v)#

Convert a string to a boolean.

Supported true values: ‘yes’, ‘true’, ‘t’, ‘y’, ‘1’ Supported false values: ‘no’, ‘false’, ‘f’, ‘n’, ‘0’

Parameters:

v (str) – String to convert.

Returns:

Converted boolean value.

Return type:

bool

Raises:

argparse.ArgumentTypeError – If the value cannot be converted to boolean.