Files
ImageApi/enhance.example.toml
T

66 lines
3.6 KiB
TOML

# ImageApi Enhance configuration (#192). Copy to `enhance.toml` next to
# `.env` (or point ENHANCE_CONFIG_PATH at it). Every key is optional: delete
# a line to get its default (trailing `default:` comment). Without `url`,
# Enhance is off and GET /enhance/templates reports `available: false`.
#
# ComfyUI has no auth and stays LAN-only; the apps only ever talk to
# ImageApi, which relays previews. Nothing in this file is a secret.
#
# Templates are API-format workflows (ComfyUI -> Workflow -> Export (API)).
# ImageApi finds the nodes it fills in by `_meta.title`, so re-exporting
# after editing the graph keeps working:
# imageapi:source required Load Image From Path; gets the photo's path
# imageapi:save required Save Image Version; forced to require_approval
# imageapi:prompt optional text node; its `text`, `prompt` or `value`
# input (first one present) gets the user's text
# imageapi:reference optional second loader for a context photo. With no
# reference in the request the node and every
# link to it are removed from the prompt.
# A template missing a required title (or with a prompt node that has none of
# the three inputs) is rejected at startup with a log line; the rest still load.
# Never edit the template files from here: ImageApi only reads them.
url = "http://192.168.10.218:8188" # default: unset (Enhance disabled)
timeout_secs = 15 # default: 15; per ComfyUI request
probe_ttl_secs = 10 # default: 10; how long `available` is cached
poll_secs = 2 # default: 2; job poll interval
idle_free_secs = 300 # default: 300; ComfyUI idle (empty queue, newest
# history entry this old) -> POST /free once. 0 = off
unreachable_grace_secs = 120 # default: 120; active job -> `unavailable` after this
default_template = "restore" # default: the first template
warn_above_megapixels = 1.5 # default: 1.5; clients warn above this original size
# Library path prefix <-> ComfyUI path prefix; longest prefix wins and
# separators are converted, in both directions. With no entries, paths pass
# through unchanged. A mapped drive (Z:\) only exists in the logged-in
# session; use a UNC prefix (\\nas\) if ComfyUI ever runs as a service.
[[path_map]]
from = "/media/nas/"
to = 'Z:\'
[[template]]
name = "restore" # stable id clients send
label = "Restore"
description = "Sharpen and clean up the photo (about 3 s)."
file = "/media/nas/image_fibo2_restore_turbo_imageapi_API.json" # relative = beside this file
# append: the template's prompt is a full base instruction; the user's text
# is appended after prompt_join. Empty text leaves the prompt as is.
prompt_mode = "append" # default: "append" | "replace"
prompt_join = " " # default: " " (single space); e.g. "\n\nAdditional instructions: "
output_megapixels = 1.0 # default: 1.0; ~1 MP output, for the client's size warning
[[template]]
name = "edit"
label = "Edit"
description = "Change the photo as you describe."
file = "/media/nas/image_fibo2_edit_turbo_imageapi_API.json"
# replace: the user's text IS the prompt, so it is required (empty = 400).
prompt_mode = "replace"
# The Dev variant (50 steps, ~50 s) is no better on the archive test set, so
# it is not the default; configure it if you want it:
# [[template]]
# name = "restore-dev"
# label = "Restore (Dev, slow)"
# file = "/media/nas/image_fibo2_restore_imageapi_API.json"