Commit
•
a9b22af
1
Parent(s):
6cbe857
Update README.md
Browse files
README.md
CHANGED
@@ -156,3 +156,22 @@ if __name__=='__main__':
|
|
156 |
generate_images(model_name, prompts_path, save_path, device=device, safety_config=safety_config,
|
157 |
num_samples=num_samples,from_case=from_case, model_version=model_version)
|
158 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
generate_images(model_name, prompts_path, save_path, device=device, safety_config=safety_config,
|
157 |
num_samples=num_samples,from_case=from_case, model_version=model_version)
|
158 |
```
|
159 |
+
|
160 |
+
## If you want to learn about SafeGen's capability without the protection of an external safety filter.
|
161 |
+
|
162 |
+
You can comment on the run_safety_checker function used in Step 9. This code can be found in
|
163 |
+
```Bash
|
164 |
+
<Your_conda_env>/lib/python3.8/site-packages/diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py
|
165 |
+
```
|
166 |
+
|
167 |
+
```Python
|
168 |
+
# 8. Post-processing
|
169 |
+
image = self.decode_latents(latents)
|
170 |
+
|
171 |
+
# 9. Run safety checker
|
172 |
+
# image, has_nsfw_concept, flagged_images = self.run_safety_checker(
|
173 |
+
# image, device, prompt_embeds.dtype, enable_safety_guidance
|
174 |
+
# )
|
175 |
+
has_nsfw_concept = None; flagged_images = None
|
176 |
+
|
177 |
+
```
|