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

Commit

Permalink
Merge pull request #55 from xingren23/dev
Browse files Browse the repository at this point in the history
fix: generate image exception
  • Loading branch information
xingren23 authored Dec 27, 2023
2 parents 0cca603 + ded7ec6 commit 6cc531c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions modules/comfyflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ def generate(self):

logger.info(f"Sending prompt to server, {prompt}")
queue = st.session_state.get('progress_queue', None)
prompt_id = self.comfy_client.gen_images(prompt, queue)
st.session_state['preview_prompt_id'] = prompt_id
try:
prompt_id = self.comfy_client.gen_images(prompt, queue)
st.session_state['preview_prompt_id'] = prompt_id
logger.info(f"generate prompt id: {prompt_id}")
except Exception as e:
st.session_state['preview_prompt_id'] = None
logger.warning(f"generate prompt error, {e}")

def get_outputs(self):
# get output images by prompt_id
Expand Down Expand Up @@ -223,6 +228,10 @@ def create_ui(self, show_header=True):
progress_placeholder = st.empty()
img_placeholder = st.empty()
if gen_button:
if st.session_state['preview_prompt_id'] is None:
st.warning("Generate failed, please check ComfyFlowApp and ComfyUI console log.")
st.stop()

# update progress
output_progress = progress_placeholder.progress(value=0.0, text="Generate image")
while True:
Expand Down
2 changes: 1 addition & 1 deletion modules/publish_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def publish_app_ui(app, cookies):
missing_models.append({class_type: value})

with st.container():
operation_row = row([3, 6.2, 0.8])
operation_row = row([3, 6, 1])

missing_button = operation_row.button("Request missing nodes and models", key='missing_button',
help="Request missing comfyui custom nodes and models", disabled=len(missing_nodes) == 0 and len(missing_models) == 0)
Expand Down

0 comments on commit 6cc531c

Please sign in to comment.