下载地址
https://www.zhengdianxue.com/wp-content/uploads/skills/org-i17594xw--afci-image-to-image.zip将提示词发送给你的 AI 安装该 skills
请根据 https://skillhub.cn/install/skillhub.md,安装 @org-i17594xw/afci-image-to-image。阅读全文 (展开查看完整说明)
概述
AFCI Image to Image
Package version: 1.1.0.
Invoke upload, generation, and task status only through SkillHub's authenticated Skill transport. The platform must attach its verified caller identity, timestamp, nonce, content digest, and signature. Never manufacture or replay authentication headers. Stop before payment on 401 or 503 CALLER_AUTH_PROTOCOL_UNAVAILABLE.
Upload one reference image into the isolated SkillPay quarantine area, then request a paid asynchronous transformation. Never pass external image URLs to the generation endpoint.
Confirm authorization
Confirm that the user owns or may use the source image. If a recognizable person appears, obtain explicit confirmation that the user is authorized to transform that portrait. Reject requests involving impersonation, non-consensual intimate imagery, identity fraud, or other prohibited content.
Upload the reference
POST https://api.hpminiprogram.top/api/v1/skill-pay/images/uploads
Content-Type: multipart/form-dataSend exactly one file part. Supported types are JPEG, PNG, and WebP; size must be 1 byte through 10 MiB. A successful upload returns HTTP 201:
{
"code": "UPLOAD_CREATED",
"uploadToken": "short-lived opaque token",
"expiresAt": "ISO-8601",
"mimeType": "image/png",
"sizeBytes": 12345
}Preserve the short-lived uploadToken. The first valid generation request reserves it to that order; the 402 does not invalidate it, so the exact same token remains valid only for the paid retry of that order. It cannot be used to create another order. Do not expose or guess internal object keys.
For upload 413, choose a file no larger than 10 MiB. For 415 or validation failure, use a genuine JPEG, PNG, or WebP rather than changing only the extension. The Skill API does not apply a per-caller daily upload quota; if an upstream capacity layer returns 429, honor Retry-After. For a network error or 5xx, retry the same file at most twice; if no success response was received, a later successful retry may return a new token, and only that confirmed token should be used.
Request the transformation
POST https://api.hpminiprogram.top/api/v1/skill-pay/images/image-to-image
Content-Type: application/json
Idempotency-Key: <UUID v4>Use the strict body:
{
"prompt": "Describe the requested transformation and desired result",
"uploadToken": "token returned by the upload endpoint",
"outputCount": 1,
"portraitAuthorizationConfirmed": false
}Set portraitAuthorizationConfirmed to true only after explicit authorization for a recognizable person. Generate one UUID v4 and preserve it. Do not add fields. Keep the body identical after payment. After trimming surrounding whitespace, prompt must contain 1 through 800 characters.
Complete payment
- Check that
weixinpay_payis available. If unavailable, tell the user that this Agent cannot complete the paid request and stop. - POST without
X-Out-Trade-No. - On
402, preserveWeixinPay-RequiredandX-Out-Trade-Nofrom the response headers. - Pass the
WeixinPay-Requiredvalue aspaymentCodetoweixinpay_payand obtain explicit user authorization. - After payment succeeds, POST the exact same body using the same
Idempotency-Key, plus the savedX-Out-Trade-No. - A newly queued task returns
202 ACCEPTED; savetask.idandtask.statusUrl. If the same paid request already reached a terminal state, the POST can instead return200with the full terminaltask; handle it using the status rules below. Never upload again or create a second order for a paid retry.
The 202 body uses the same ACCEPTED shape as the text-to-image API: top-level requestId, outTradeNo, alreadyFulfilled, and task containing id, status, absolute statusUrl, and nextPollAfterMs.
If a 402 omits either payment header, do not pay. If paid retry returns 402, wait briefly and retry the same order. Treat 409 as body mismatch. Input review and portrait-authorization failures return 400 with codes such as PORTRAIT_AUTH_REQUIRED, CONTENT_REVIEW_REJECTED, or CONTENT_REVIEW_UNAVAILABLE; do not pay for these rejected requests. An upload that expires before an order is created requires a fresh upload token. A 410 ORDER_EXPIRED means the existing order cannot be reused: if no payment occurred, ask the user before uploading again and starting a new order; if payment may have occurred, do not create another order and report the existing order for support/refund review. Honor any upstream 429 and never replace an uncertain paid order. If the paid POST returns a network error or 5xx, retry that same POST with the same body, idempotency key, order number, and upload token up to three times; this is also how to recover the existing task or its refund state after an enqueue failure.
Poll and return the image
Before using task.statusUrl, require HTTPS origin https://api.hpminiprogram.top and a path beginning /api/v1/skill-pay/images/tasks/. Reject any other origin or path. GET the URL with the saved X-Out-Trade-No header.
Poll for at most 10 minutes. Use nextPollAfterMs when it is an integer from 1000 through 30000; otherwise wait 2000 ms. For 429, honor Retry-After; for network errors or 5xx, back off up to 10 seconds. If the deadline expires, report that processing is still pending and preserve the same task/order for later checking.
202: queued or running; poll later.200withcode: "SUCCESS"andtask.status: "succeeded": return URLs fromtask.images[]; each item also containsmimeTypeandsizeBytes.200with a failed orrefund_requiredtask: reporttask.errorCodeandtask.refundStatus(required,processing, orfailed) without inventing an image or claiming a completed refund. Preserve the same task/order during recovery and do not upload or charge again.200withcode: "REFUNDED"andtask.status: "refunded": report that the recorded refund has completed; do not claim an image was generated.401,403, or404: stop; do not send the order header to another URL.- A malformed response or unexpected status/code is a service error, not a generated image.
Generated image URLs are short-lived, typically about five minutes. Present or download them promptly and tell the user that an expired URL requires checking the same task again, not creating a new paid order.
Do not expose source storage keys, provider credentials, moderation internals, prompts from other requests, or server logs.