Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safety checker doesn't work with Latent Consistency Model pipeline #790

Closed
adrianboguszewski opened this issue Jun 28, 2024 · 0 comments · Fixed by #802
Closed

Safety checker doesn't work with Latent Consistency Model pipeline #790

adrianboguszewski opened this issue Jun 28, 2024 · 0 comments · Fixed by #802
Assignees

Comments

@adrianboguszewski
Copy link

When I run the following code:

from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
from optimum.intel import OVLatentConsistencyModelPipeline

safety_checker = StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker")
ov_pipeline = OVLatentConsistencyModelPipeline.from_pretrained("OpenVINO/LCM_Dreamshaper_v7-int8-ov", device="AUTO")
ov_pipeline.safety_checker = safety_checker

result = ov_pipeline(prompt="", num_inference_steps=2, width=256, height=256, guidance_scale=8.0).images

I get:
TypeError: Cannot handle this data type: (1, 1, 256), |u1

The problem is with the tensor layout. The safety checker expects HWC and gets CHW.

Also, assigning the checker in from_pretrained doesn't have any effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants