1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

a few small fix: proprocess, cpu_offloading, attention backend

This commit is contained in:
yiyi@huggingface.co
2025-11-30 18:38:33 +00:00
parent c22915d6c4
commit f9cb82b64f
3 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -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]

View File

@@ -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__(