File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/diffusers/pipelines/hunyuan_video Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -441,6 +441,8 @@ def check_inputs(
441441 prompt_embeds = None ,
442442 callback_on_step_end_tensor_inputs = None ,
443443 prompt_template = None ,
444+ true_cfg_scale = 1.0 ,
445+ guidance_scale = 1.0 ,
444446 ):
445447 if height % 16 != 0 or width % 16 != 0 :
446448 raise ValueError (f"`height` and `width` have to be divisible by 16 but are { height } and { width } ." )
@@ -479,6 +481,13 @@ def check_inputs(
479481 f"`prompt_template` has to contain a key `template` but only found { prompt_template .keys ()} "
480482 )
481483
484+ if true_cfg_scale > 1.0 and guidance_scale > 1.0 :
485+ logger .warning (
486+ "Both `true_cfg_scale` and `guidance_scale` are greater than 1.0. This will result in both "
487+ "classifier-free guidance and embedded-guidance to be applied. This is not recommended "
488+ "as it may lead to higher memory usage, slower inference and potentially worse results."
489+ )
490+
482491 def prepare_latents (
483492 self ,
484493 image : torch .Tensor ,
@@ -718,6 +727,8 @@ def __call__(
718727 prompt_embeds ,
719728 callback_on_step_end_tensor_inputs ,
720729 prompt_template ,
730+ true_cfg_scale ,
731+ guidance_scale ,
721732 )
722733
723734 image_condition_type = self .transformer .config .image_condition_type
You can’t perform that action at this time.
0 commit comments