diff --git a/src/diffusers/models/attention_dispatch.py b/src/diffusers/models/attention_dispatch.py index 8504504981..7face061b2 100644 --- a/src/diffusers/models/attention_dispatch.py +++ b/src/diffusers/models/attention_dispatch.py @@ -278,6 +278,7 @@ def attention_backend(backend: Union[str, AttentionBackendName] = AttentionBacke backend = AttentionBackendName(backend) _check_attention_backend_requirements(backend) + _maybe_download_kernel_for_backend(backend) old_backend = _AttentionBackendRegistry._active_backend _AttentionBackendRegistry._active_backend = backend diff --git a/src/diffusers/pipelines/hunyuan_video1_5/image_processor.py b/src/diffusers/pipelines/hunyuan_video1_5/image_processor.py index 6e3e818c7d..efeb0e2a5f 100644 --- a/src/diffusers/pipelines/hunyuan_video1_5/image_processor.py +++ b/src/diffusers/pipelines/hunyuan_video1_5/image_processor.py @@ -52,7 +52,7 @@ def get_closest_ratio(height: float, width: float, ratios: list, buckets: list): if aspect_ratio >= 1: indices = [(index, x) for index, x in enumerate(diff_ratios) if x <= 0] else: - indices = [(index, x) for index, x in enumerate(diff_ratios) if x > 0] + indices = [(index, x) for index, x in enumerate(diff_ratios) if x >= 0] closest_ratio_id = min(indices, key=lambda pair: abs(pair[1]))[0] closest_size = buckets[closest_ratio_id] diff --git a/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py b/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py index ee25031f60..7e23d2da3e 100644 --- a/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py +++ b/src/diffusers/pipelines/hunyuan_video1_5/pipeline_hunyuan_video1_5.py @@ -195,7 +195,7 @@ class HunyuanVideo15Pipeline(DiffusionPipeline): [ClassifierFreeGuidance]for classifier free guidance. """ - model_cpu_offload_seq = "text_encoder->text_encoder_2->transformer->vae" + model_cpu_offload_seq = "text_encoder->transformer->vae" _callback_tensor_inputs = ["latents", "prompt_embeds"] def __init__(