hpwang commited on
Commit
ad27dda
·
verified ·
1 Parent(s): 4122069

Update tools/Fooocus/modules/hack_async_worker_class.py

Browse files
tools/Fooocus/modules/hack_async_worker_class.py CHANGED
@@ -16,7 +16,7 @@ import modules.core as core
16
  import modules.flags as flags
17
  import modules.config
18
  import modules.patch
19
- import ldm_patched.modules.model_management
20
  import extras.preprocessors as preprocessors
21
  import modules.inpaint_worker as inpaint_worker
22
  import modules.constants as constants
@@ -859,8 +859,8 @@ class Hack_worker():
859
  execution_start_time = time.perf_counter()
860
 
861
  try:
862
- if async_task.last_stop is not False:
863
- ldm_patched.modules.model_management.interrupt_current_processing()
864
  positive_cond, negative_cond = task['c'], task['uc']
865
 
866
  if 'cn' in goals:
@@ -903,14 +903,14 @@ class Hack_worker():
903
  self.progressbar(async_task, current_progress, 'Checking for NSFW content ...')
904
  imgs = default_censor(imgs)
905
  outputs.append(imgs[0])
906
- except ldm_patched.modules.model_management.InterruptProcessingException as e:
907
- if async_task.last_stop == 'skip':
908
- print('User skipped')
909
- async_task.last_stop = False
910
- continue
911
- else:
912
- print('User stopped')
913
- break
914
  execution_time = time.perf_counter() - execution_start_time
915
  print(f'Generating and saving time: {execution_time:.2f} seconds')
916
  async_task.processing = False
 
16
  import modules.flags as flags
17
  import modules.config
18
  import modules.patch
19
+ # import ldm_patched.modules.model_management
20
  import extras.preprocessors as preprocessors
21
  import modules.inpaint_worker as inpaint_worker
22
  import modules.constants as constants
 
859
  execution_start_time = time.perf_counter()
860
 
861
  try:
862
+ # if async_task.last_stop is not False:
863
+ # ldm_patched.modules.model_management.interrupt_current_processing()
864
  positive_cond, negative_cond = task['c'], task['uc']
865
 
866
  if 'cn' in goals:
 
903
  self.progressbar(async_task, current_progress, 'Checking for NSFW content ...')
904
  imgs = default_censor(imgs)
905
  outputs.append(imgs[0])
906
+ # except ldm_patched.modules.model_management.InterruptProcessingException as e:
907
+ # if async_task.last_stop == 'skip':
908
+ # print('User skipped')
909
+ # async_task.last_stop = False
910
+ # continue
911
+ # else:
912
+ # print('User stopped')
913
+ # break
914
  execution_time = time.perf_counter() - execution_start_time
915
  print(f'Generating and saving time: {execution_time:.2f} seconds')
916
  async_task.processing = False