Filter NSFW images (if enabled) during live preview

This commit is contained in:
cmdr2 2023-03-16 11:30:16 +05:30
parent 3507f91090
commit ca99b87319

View File

@ -146,6 +146,9 @@ def make_step_callback(
def update_temp_img(x_samples, task_temp_images: list):
partial_images = []
images = latent_samples_to_images(context, x_samples)
if task_data.block_nsfw:
images = apply_filters(context, "nsfw_checker", images)
for i, img in enumerate(images):
buf = img_to_buffer(img, output_format="JPEG")