Skip to content

Commit

Permalink
Fix issue where the generation api always returns single image
Browse files Browse the repository at this point in the history
  • Loading branch information
konieshadow committed Nov 15, 2023
1 parent 8aec8db commit 82454f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fooocusapi/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,8 @@ def callback(step, x0, x, total_steps, y):
log(x, d, single_line_number=3)

# Fooocus async_worker.py code end

results += imgs
except model_management.InterruptProcessingException as e:
print("User stopped")
results.append(ImageGenerationResult(
Expand All @@ -720,7 +722,7 @@ def callback(step, x0, x, total_steps, y):
if queue_task.finish_with_error:
task_queue.finish_task(queue_task.seq)
return queue_task.task_result
return yield_result(imgs, tasks)
return yield_result(results, tasks)
except Exception as e:
print('Worker error:', e)
if not queue_task.is_finished:
Expand Down

0 comments on commit 82454f8

Please sign in to comment.