[Feature]: Adds distilled LoRA support for diffusion models (#2783)

Signed-off-by: Songrui625 <songrui625@gmail.com>
This commit is contained in:
Jerry Song authored and GitHub committed 2026-08-11 14:23:43 +00:00
1 parent 348cf95a89
commit 89015d5cad
24 files changed
+1283 -33

No files matched your search

+4 -3
View File
@@ -70,9 +70,10 @@ def find_module_with_attr(model, attr_name="transformer"):
return None
def get_transformer_from_pipeline(pipeline: Any):
pipe = find_module_with_attr(pipeline, attr_name="transformer")
def get_transformer_from_pipeline(pipeline: Any, transformer_name: str = "transformer"):
"""Return a named transformer from a pipeline or pipeline wrapper."""
pipe = find_module_with_attr(pipeline, attr_name=transformer_name)
if pipe is not None:
return pipe.transformer
return getattr(pipe, transformer_name)
return None