Updated generation pages.

This commit is contained in:
Aodhan Collins
2026-03-15 17:45:17 +00:00
parent 79bbf669e2
commit d756ea1d0e
30 changed files with 2033 additions and 189 deletions

View File

@@ -6,6 +6,22 @@ from flask import current_app
logger = logging.getLogger('gaze')
def get_loaded_checkpoint():
"""Return the checkpoint path currently loaded in ComfyUI, or None."""
try:
url = current_app.config.get('COMFYUI_URL', 'http://127.0.0.1:8188')
resp = requests.get(f'{url}/history', timeout=3)
if resp.ok:
history = resp.json()
if history:
latest = max(history.values(), key=lambda j: j.get('status', {}).get('status_str', ''))
nodes = latest.get('prompt', [None, None, {}])[2]
return nodes.get('4', {}).get('inputs', {}).get('ckpt_name')
except Exception:
pass
return None
def _ensure_checkpoint_loaded(checkpoint_path):
"""Check if the desired checkpoint is loaded in ComfyUI, and force reload if not."""
if not checkpoint_path: