mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
Fix Diffusers requires_aesthetics_score
This commit is contained in:
+10
-1
@@ -1299,10 +1299,19 @@ def switch_pipe(cls: diffusers.DiffusionPipeline, pipeline: diffusers.DiffusionP
|
||||
|
||||
|
||||
def set_diffuser_pipe(pipe, new_pipe_type):
|
||||
n = getattr(pipe.__class__, '__name__', '')
|
||||
|
||||
if new_pipe_type == DiffusersTaskType.TEXT_2_IMAGE and 'StableDiffusionXL' in n and 'requires_aesthetics_score' in pipe.config:
|
||||
# Diffusers adds requires_aesthetics_score with img2img and complains if requires_aesthetics_score exist in txt2img
|
||||
internal_dict = dict(pipe._internal_dict)
|
||||
internal_dict.pop('requires_aesthetics_score', None)
|
||||
del pipe._internal_dict
|
||||
pipe.register_to_config(**internal_dict)
|
||||
|
||||
if get_diffusers_task(pipe) == new_pipe_type:
|
||||
return pipe
|
||||
|
||||
# skip specific pipelines
|
||||
n = getattr(pipe.__class__, '__name__', '')
|
||||
if n in ['StableDiffusionReferencePipeline', 'StableDiffusionAdapterPipeline', 'AnimateDiffPipeline', 'AnimateDiffSDXLPipeline']:
|
||||
return pipe
|
||||
if 'Onnx' in pipe.__class__.__name__:
|
||||
|
||||
Reference in New Issue
Block a user