huggingface / huggingface/diffusers

how to disable safty_checker in FlaxStableDiffusionPipeline

Open
#9,031 4 comments 0 reactions 0 assignees View on GitHub
bug stale
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

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 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.