Skip to content

Commit

Permalink
more elegant generator to subscriptable conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
AyaanShah2204 committed Jun 23, 2023
1 parent 9beaac6 commit 4638921
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/stable_diffusion/web/ui/img2img_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def img2img_api(
)

# Converts generator type to subscriptable
res = list(res)[0]
res = next(res)

return {
"images": encode_pil_to_base64(res[0]),
Expand Down
2 changes: 1 addition & 1 deletion apps/stable_diffusion/web/ui/upscaler_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def upscaler_api(
ondemand=False,
)
# Converts generator type to subscriptable
res = list(res)[0]
res = next(res)

return {
"images": encode_pil_to_base64(res[0]),
Expand Down

0 comments on commit 4638921

Please sign in to comment.