mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
fix progressbar call for nsfw output
This commit is contained in:
@@ -56,12 +56,12 @@ def worker():
|
|||||||
print(f'[Fooocus] {text}')
|
print(f'[Fooocus] {text}')
|
||||||
async_task.yields.append(['preview', (number, text, None)])
|
async_task.yields.append(['preview', (number, text, None)])
|
||||||
|
|
||||||
def yield_result(async_task, imgs, do_not_show_finished_images=False):
|
def yield_result(async_task, imgs, do_not_show_finished_images=False, progressbar_index=13):
|
||||||
if not isinstance(imgs, list):
|
if not isinstance(imgs, list):
|
||||||
imgs = [imgs]
|
imgs = [imgs]
|
||||||
|
|
||||||
if modules.config.default_black_out_nsfw:
|
if modules.config.default_black_out_nsfw:
|
||||||
progressbar(progressbar_index, 'Checking for NSFW content ...')
|
progressbar(async_task, progressbar_index, 'Checking for NSFW content ...')
|
||||||
imgs = censor_batch(imgs)
|
imgs = censor_batch(imgs)
|
||||||
|
|
||||||
async_task.results = async_task.results + imgs
|
async_task.results = async_task.results + imgs
|
||||||
@@ -725,7 +725,7 @@ def worker():
|
|||||||
d.append((f'LoRA [{n}] weight', w))
|
d.append((f'LoRA [{n}] weight', w))
|
||||||
log(x, d, single_line_number=3)
|
log(x, d, single_line_number=3)
|
||||||
|
|
||||||
yield_result(async_task, imgs, do_not_show_finished_images=len(tasks) == 1, progressbar_index=int(15.0 + 85.0 * float((current_task_id + 1) * steps) / float(all_steps))))
|
yield_result(async_task, imgs, do_not_show_finished_images=len(tasks) == 1, progressbar_index=int(15.0 + 85.0 * float((current_task_id + 1) * steps) / float(all_steps)))
|
||||||
except fcbh.model_management.InterruptProcessingException as e:
|
except fcbh.model_management.InterruptProcessingException as e:
|
||||||
if shared.last_stop == 'skip':
|
if shared.last_stop == 'skip':
|
||||||
print('User skipped')
|
print('User skipped')
|
||||||
|
|||||||
Reference in New Issue
Block a user