MCPcopy Index your code
hub / github.com/FunAudioLLM/ThinkSound / generate_diffusion_cond

Function generate_diffusion_cond

ThinkSound/inference/generation.py:11–171  ·  view source on GitHub ↗

Generate audio from a prompt using a diffusion model. Args: model: The diffusion model to use for generation. steps: The number of diffusion steps to use. cfg_scale: Classifier-free guidance scale conditioning: A dictionary of conditioning parameters to

(
        model,
        steps: int = 250,
        cfg_scale=6,
        conditioning: dict = None,
        conditioning_tensors: tp.Optional[dict] = None,
        negative_conditioning: dict = None,
        negative_conditioning_tensors: tp.Optional[dict] = None,
        batch_size: int = 1,
        sample_size: int = 2097152,
        sample_rate: int = 48000,
        seed: int = -1,
        device: str = "cuda",
        init_audio: tp.Optional[tp.Tuple[int, torch.Tensor]] = None,
        init_noise_level: float = 1.0,
        mask_args: dict = None,
        return_latents = False,
        **sampler_kwargs
        )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

generateMethod · 0.85
generateMethod · 0.85

Calls 7

prepare_audioFunction · 0.85
build_maskFunction · 0.85
sample_kFunction · 0.85
sample_rfFunction · 0.85
encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected