Fix gallery not being refreshed correctly

This commit is contained in:
Sakura-Luna 2023-04-20 14:53:04 +08:00
parent 22bcc7be42
commit 2c24e09dfc
1 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,7 @@ from modules.shared import opts, cmd_opts
import modules.shared as shared
import modules.processing as processing
from modules.ui import plaintext_to_html
from time import time
def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, steps: int, sampler_index: int, restore_faces: bool, tiling: bool, n_iter: int, batch_size: int, cfg_scale: float, seed: int, subseed: int, subseed_strength: float, seed_resize_from_h: int, seed_resize_from_w: int, seed_enable_extras: bool, height: int, width: int, enable_hr: bool, denoising_strength: float, hr_scale: float, hr_upscaler: str, hr_second_pass_steps: int, hr_resize_x: int, hr_resize_y: int, override_settings_texts, *args):
@ -63,6 +64,9 @@ def txt2img(id_task: str, prompt: str, negative_prompt: str, prompt_styles, step
if opts.samples_log_stdout:
print(generation_info_js)
for img in processed.images:
img.already_saved_as += f'?{int(time())}'
if opts.do_not_show_images:
processed.images = []