techfreakworm commited on
Commit
107f495
·
unverified ·
1 Parent(s): 19489a8

fix(backend): pass cache_args to PromptExecutor + dump worker tracebacks

Browse files

PromptExecutor.execute_async unconditionally reads self.cache_args["ram"]
even when cache_type is the default false (line 727). NoneType-subscript
otherwise. Default to {ram: 16.0, lru: 0}. Also stderr-print worker
tracebacks so the full failure stack reaches the log.

Files changed (1) hide show
  1. backend.py +10 -2
backend.py CHANGED
@@ -113,7 +113,13 @@ class ComfyUILibraryBackend:
113
  # PromptExecutor expects a `server` with client_id, send_sync, last_node_id,
114
  # queue_updated. A minimal stub no-ops all of them — we don't run a real
115
  # websocket server, we surface progress via comfy.utils.PROGRESS_BAR_HOOK.
116
- self._executor = execution.PromptExecutor(server=_StubServer())
 
 
 
 
 
 
117
 
118
  def __repr__(self) -> str:
119
  return f"ComfyUILibraryBackend(comfy_dir={self._comfy_dir!r})"
@@ -172,11 +178,13 @@ class ComfyUILibraryBackend:
172
  video_path = _first_video_path(outputs) or ""
173
  _push(OutputEvent(video_path=video_path))
174
  except Exception as exc:
 
 
175
  _push(
176
  ErrorEvent(
177
  category=_classify(exc),
178
  message=str(exc),
179
- traceback=tb_mod.format_exc(),
180
  )
181
  )
182
  finally:
 
113
  # PromptExecutor expects a `server` with client_id, send_sync, last_node_id,
114
  # queue_updated. A minimal stub no-ops all of them — we don't run a real
115
  # websocket server, we surface progress via comfy.utils.PROGRESS_BAR_HOOK.
116
+ # cache_args["ram"] is read unconditionally inside execute_async even when
117
+ # cache_type is the default false — provide a sensible default so it doesn't
118
+ # NoneType-subscript at line 727.
119
+ self._executor = execution.PromptExecutor(
120
+ server=_StubServer(),
121
+ cache_args={"ram": 16.0, "lru": 0},
122
+ )
123
 
124
  def __repr__(self) -> str:
125
  return f"ComfyUILibraryBackend(comfy_dir={self._comfy_dir!r})"
 
178
  video_path = _first_video_path(outputs) or ""
179
  _push(OutputEvent(video_path=video_path))
180
  except Exception as exc:
181
+ tb_text = tb_mod.format_exc()
182
+ print(f"[backend] worker exception:\n{tb_text}", file=sys.stderr, flush=True)
183
  _push(
184
  ErrorEvent(
185
  category=_classify(exc),
186
  message=str(exc),
187
+ traceback=tb_text,
188
  )
189
  )
190
  finally: