Skip to content

New LCM support in core seems broken #5645

@vladmandic

Description

@vladmandic

Describe the bug

Trying to load LCM model using standard methods (DiffusionPipeline or AutoPipelineForText2Image)
fails due to missing scheduler component in pipeline.
(note that LCM has its own scheduler, so that should be handled by the pipeline).

Loading same model using old way via custom_pipeline script works fine.
Model has been freshly downloaded from HF, so its not a question of an older/incompatible model.

Note: support for LCM in core was added via #5632

Reproduction

import torch
import diffusers

print('')
try: # fails
    pipe = diffusers.DiffusionPipeline.from_pretrained('SimianLuo/LCM_Dreamshaper_v7', cache_dir='/mnt/f/Models/Diffusers')
    print('DiffusionPipeline loaded:', pipe.__class__.__name__)
except Exception as e:
    print('DiffusionPipeline error:', e)

print('')
try: # fails
    pipe = diffusers.AutoPipelineForText2Image.from_pretrained('SimianLuo/LCM_Dreamshaper_v7', cache_dir='/mnt/f/Models/Diffusers')
    print('AutoPipelineForText2Image loaded:', pipe.__class__.__name__)
except Exception as e:
    print('AutoPipelineForText2Image error:', e)

print('')
try: # works
    pipe = diffusers.AutoPipelineForImage2Image.from_pretrained('SimianLuo/LCM_Dreamshaper_v7', custom_pipeline='latent_consistency_txt2img', cache_dir='/mnt/f/Models/Diffusers')
    print('CustomPipeline loaded:', pipe.__class__.__name__)
except Exception as e:
    print('CustomPipeline error:', e)

Logs

Loading pipeline components...: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00,  8.70it/s]
DiffusionPipeline error: Pipeline <class 'diffusers.pipelines.latent_consistency_models.pipeline_latent_consistency_text2img.LatentConsistencyModelPipeline'> expected {'tokenizer', 'text_encoder', 'vae', 'feature_extractor', 'unet', 'safety_checker', 'scheduler'}, but only {'text_encoder', 'tokenizer', 'vae', 'feature_extractor', 'unet', 'safety_checker'} were passed.

Loading pipeline components...: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00, 10.49it/s]
AutoPipelineForText2Image error: Pipeline <class 'diffusers.pipelines.latent_consistency_models.pipeline_latent_consistency_text2img.LatentConsistencyModelPipeline'> expected {'tokenizer', 'text_encoder', 'vae', 'feature_extractor', 'unet', 'safety_checker', 'scheduler'}, but only {'text_encoder', 'tokenizer', 'vae', 'feature_extractor', 'unet', 'safety_checker'} were passed.

/home/vlado/.local/lib/python3.11/site-packages/huggingface_hub/file_download.py:660: FutureWarning: 'cached_download' is the legacy way to download files from the HF hub, please consider upgrading to 'hf_hub_download'
  warnings.warn(
Loading pipeline components...: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00,  9.95it/s]
CustomPipeline loaded: LatentConsistencyModelPipeline

System Info

diffusers 0.22.0.dev0 commit dd9a5ca

Who can help?

@yiyixuxu @DN6 @patrickvonplaten @sayakpaul @patrickvonplaten

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions