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:
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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__(
|
||||
|
||||
Reference in New Issue
Block a user