Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
fix: display gifs image
Browse files Browse the repository at this point in the history
  • Loading branch information
xingren23 committed Dec 18, 2023
1 parent 7ca22c0 commit 948afd3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/comfyflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,15 @@ def get_outputs(self):
return 'images', images_output
elif 'gifs' in node_output:
gifs_output = []
format = 'gifs'
for gif in node_output['gifs']:
if gif['format'] == 'image/gif' or gif['format'] == 'image/webp':
format = 'images'
gif_url = self.comfy_client.get_image_url(gif['filename'], gif['subfolder'], gif['type'])
gifs_output.append(gif_url)

logger.info(f"Got gifs from server, {node_id}, {len(gifs_output)}")
return 'gifs', gifs_output
return format, gifs_output


def create_ui_input(self, node_id, node_inputs):
Expand Down Expand Up @@ -255,7 +258,7 @@ def create_ui(self, show_header=True):
img_placeholder.image(preview_image, use_column_width=True, caption="Preview")
except Exception as e:
logger.warning(f"get progress exception, {e}")
st.warning(f"get progress exception {e}")
# st.warning(f"get progress exception {e}")
else:
output_image = Image.open('./public/images/output-none.png')
logger.info("default output")
Expand Down

0 comments on commit 948afd3

Please sign in to comment.