move nsfw filter to core module, make preview hiding more effective

This commit is contained in:
Manuel Schmid 2023-11-22 23:19:27 +01:00
parent 87fc830981
commit b1f79a4b44
2 changed files with 2 additions and 2 deletions

View File

@ -301,7 +301,7 @@ def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=7.0, sa
def callback(step, x0, x, total_steps):
fcbh.model_management.throw_exception_if_processing_interrupted()
y = None
if previewer is not None and not modules.advanced_parameters.disable_preview:
if previewer is not None and not modules.advanced_parameters.disable_preview and not (modules.config.default_black_out_nsfw and modules.config.default_hide_preview_if_black_out_nsfw):
y = previewer(x0, previewer_start + step, previewer_end)
if callback_function is not None:
callback_function(previewer_start + step, x0, x, previewer_end, y)

View File

@ -57,7 +57,7 @@ def generate_clicked(task):
percentage, title, image = product
yield gr.update(visible=True, value=modules.html.make_progress_html(percentage, title)), \
gr.update(visible=True, value=image) if image is not None and not (modules.config.default_black_out_nsfw and modules.config.default_hide_preview_if_black_out_nsfw) else gr.update(), \
gr.update(visible=True, value=image) if image is not None else gr.update(), \
gr.update(), \
gr.update(visible=False)
if flag == 'results':