Skip to content

how to disable safty_checker in FlaxStableDiffusionPipeline #9031

@ghost

Description

Describe the bug

! python3 -m pip install -U tensorflow-cpu
import diffusers, os
pipeline = diffusers.StableDiffusionPipeline.from_single_file('https://huggingface.co/chaowenguo/pal/blob/main/chilloutMix-Ni.safetensors')
pipeline.save_pretrained('chilloutMix', safe_serialization=False)
pipeline, params = diffusers.FlaxStableDiffusionPipeline.from_pretrained('./chilloutMix', from_pt=True)

I always complains

Pipeline <class 'diffusers.pipelines.stable_diffusion.pipeline_flax_stable_diffusion.FlaxStableDiffusionPipeline'> expected {'text_encoder', 'unet', 'scheduler', 'safety_checker', 'feature_extractor', 'vae', 'tokenizer'}, but only {'text_encoder', 'unet', 'scheduler', 'feature_extractor', 'vae', 'tokenizer'} were passed.

I want to know how to disable safety_checker in FlaxStableDiffusionPipeline
I try:
pipeline, params = diffusers.FlaxStableDiffusionPipeline.from_pretrained('./chilloutMix', from_pt=True, safety_checker=None)
Not working

Reproduction

N/A

Logs

No response

System Info

kaggle tpu vm

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleIssues that haven't received updates

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions