计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
text-generation-service【效率与协作】Operate the local FastAPI text-generation service and its legacy GIMP 2 bridge for text-to-image, text-edit, text-extend, and outpaint requests without assuming credentials, network access, model weights, GIMP, or Python 2.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task needs the GIMP-ML local service contract for text-to-image generation or text-guided image editing. It covers the HTTP lifecycle, the raw-image JSON protocol, pipeline selection, and the boundary between the Python 3 service and the legacy GIMP 2 plug-ins.
gimpml.port is
61482, but validate an operator-supplied active configuration rather than
guessing the port. The bundled inspector retains and prints only that field.cuda_available to false even when
its host might expose CUDA. This field is not proof that inference is CPU/GPU
capable. A verification-time tiny CUDA allocation was blocked by host CUDA
OOM, so GPU execution remains unverified.gimpml.port with the bundled inspector.GET /status first. It has no body and is the only route the bundled
inspector can call. It reports service, cuda_available, cuda_total,
cuda_used, cuda_free, ram_total, ram_used, ram_free, cpu, and
os.POST /download_load_model using exactly pipeline and model. The
observed success is {"status":"Loaded."}; {"status":"Error!"} is a load
failure, not a usable model.POST /run_inference with the exact fields
for that pipeline and decodes returned image plus image_shape as raw
flattened uint8 bytes. Never use the inspector for either POST route.source: "gimp2" only for the legacy bridge. Other values select the
observed GIMP 3/flattened output method; use source: "gimp3" explicitly
in new clients.See the API reference for route tables and the protocol reference for payload validation.
text_to_image: prompt-only generation. The source tool calls DALL-E 3;
model is used as the quality value (standard or hd in the bridge).text_edit_image: image plus mask and prompt. The source tool calls
DALL-E 2 image edit and resizes when the service supplies image_shape.text_extend_image: image, prompt, and ext_side (Right, Bottom,
Left, or Top). The source tool builds a transparent extension canvas and
calls DALL-E 2 image edit.text_outpaint_image: an RGBA image plus prompt. The source tool calls
DALL-E 2 image edit using transparency to represent the outpaint area.Load the same pipeline that will be sent to /run_inference. The observed
service caches only one model name and does not robustly reject every
pipeline/model mismatch; a repeated model name can therefore leave the wrong
pipeline object in memory. Use a distinct, meaningful model value or ask the
operator to restart the installed local application when changing pipeline
families. If the operator cannot control that process, classify reload
verification as blocked.
From this sub-skill directory, inspect the built-in evidence-only route table:
python scripts/inspect_service.py --list-routes
Validate an explicit local fixture or operator-supplied configuration. Only
gimpml.port is retained and displayed; unrelated fields and values are
silently discarded:
python scripts/inspect_service.py --config /path/to/operator-config.json
When an operator confirms a service is already running on loopback, the
inspector can issue only GET /status with a 0.1–5 second timeout:
python scripts/inspect_service.py \
--probe-status http://127.0.0.1:61482 --timeout 2
The probe requires plain HTTP, an explicit loopback host and port, and no URL credentials, query, or fragment. It rejects non-loopback hosts; it never sends a POST or prints response values. It checks HTTP 200, a JSON object, and all exact expected status field names. If no operator-provided process is running, connection failure is expected and is reported as blocked.
The independent payload tool checks base64, shape, dtype, and byte length by reading only a local JSON fixture:
python scripts/validate_image_payload.py --input payload.json --decode
Never use model-load or inference POSTs as a smoke test. Provider network, credentials, quota, cost approval, and real model execution are outside this sub-skill's verification boundary.
*_shape;
reject encoded PNG/JPEG data where raw pixels are required.Detailed diagnosis is in troubleshooting, including intentional source limitations and difficult synthetic cases.
This operating contract is limited to source-backed observations of route
declarations, gimpml.port, pipeline behavior, and the GIMP 2 request/response
protocol. The bundled inspector's help, static route listing, tiny config
validation, loopback rejection, and no-server failure path are locally
verifiable without a source checkout. A successful real /status response,
installed application launcher, model load, OpenAI generation/edit, output URL
download, GIMP 2 execution, Python 2 compatibility, and GPU execution are not
verified here. Keep those limits explicit rather than presenting the pipeline
as locally runnable.