Flesh out readme, Utilize client_id of comfy_runner

This commit is contained in:
Austin Mroz
2024-06-18 15:14:55 -05:00
parent 0375df5465
commit 0839fbd33c
2 changed files with 12 additions and 3 deletions
+9
View File
@@ -1,2 +1,11 @@
# ComfyUI-WorkflowCheckpointing
Automatically creates checkpoints during workflow execution. If If an workflow is canceled or ComfyUI crashes mid-execution, then these checkpoints are used when the workflow is re-queued to resume execution with minimal progress loss.
## Configuration
By default, checkpoints are saved localy to a checkpoint folder.
Networked checkpoints backed by the Salad Simple Storage Service can be enabled by setting the `SALAD_ORGANIZATION` environment variable. When deployed to salad, authentication is automatically pulled, but an api key can be applied when testing locally by setting `SALAD_API_KEY`
If a request sent to `/prompt` contains a `client_id`. It is utilized to allow independent caching of executions by multiple users.
To facilitate testing `FORCE_CRASH_AT` can be set to an integer to terminate workflow execution at a given sampling step
+3 -3
View File
@@ -218,11 +218,11 @@ prompt_route = next(filter(lambda x: x.path == '/prompt' and x.method == 'POST'
original_post_prompt = prompt_route.handler
async def post_prompt_remote(request):
json_data = await request.json()
if "prompt" in json_data and "extra_data" in json_data and "SALAD_ORGANIZATION" in os.environ:
extra_data = json_data["extra_data"]
if "SALAD_ORGANIZATION" in os.environ:
extra_data = json_data.get("extra_data", {})
#NOTE: Rendered obsolete by existing infrastructure, can be pruned
remote_files = extra_data.get("remote_files", [])
uid = extra_data.get("uid", 'local')
uid = json_data.get("client_id", 'local')
checkpoint.uid = uid
await fetch_remote_files(remote_files, uid=uid)
return await original_post_prompt(request)