mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
check attention availability
This commit is contained in:
+2
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
- PixArt-Σ requires `diffusers-0.28.0.dev0`
|
||||
|
||||
## Update for 2024-04-13
|
||||
## Update for 2024-04-15
|
||||
|
||||
- **Features**:
|
||||
- **Gallery**: list, preview, search through all your images and videos!
|
||||
@@ -81,6 +81,7 @@
|
||||
- face-hires compatibility with control modules
|
||||
- loading safetensors embeddings
|
||||
- css fixes
|
||||
- check if attention processor is compatible with model
|
||||
|
||||
## Update for 2024-03-19
|
||||
|
||||
|
||||
@@ -1269,7 +1269,10 @@ def set_diffuser_pipe(pipe, new_pipe_type):
|
||||
if get_diffusers_task(pipe) == new_pipe_type:
|
||||
return pipe
|
||||
# skip specific pipelines
|
||||
if pipe.__class__.__name__ == 'StableDiffusionReferencePipeline' or pipe.__class__.__name__ == 'StableDiffusionAdapterPipeline' or 'Onnx' in pipe.__class__.__name__:
|
||||
n = pipe.__class__.__name__
|
||||
if n in ['StableDiffusionReferencePipeline', 'StableDiffusionAdapterPipeline', 'AnimateDiffPipeline']:
|
||||
return pipe
|
||||
if 'Onnx' in pipe.__class__.__name__:
|
||||
return pipe
|
||||
|
||||
sd_checkpoint_info = getattr(pipe, "sd_checkpoint_info", None)
|
||||
@@ -1311,6 +1314,10 @@ def set_diffuser_pipe(pipe, new_pipe_type):
|
||||
|
||||
|
||||
def set_diffusers_attention(pipe, attention):
|
||||
if attention is None:
|
||||
return
|
||||
if not hasattr(pipe, "_get_signature_keys"):
|
||||
return
|
||||
module_names, _ = pipe._get_signature_keys(pipe) # pylint: disable=protected-access
|
||||
modules = [getattr(pipe, n, None) for n in module_names]
|
||||
modules = [m for m in modules if isinstance(m, torch.nn.Module) and hasattr(m, "set_attn_processor")]
|
||||
|
||||
+1
-1
Submodule wiki updated: 15c1c779f1...9c936097e6
Reference in New Issue
Block a user