Preface¶
When performing “product image background replacement and scene fusion” within an Agent, the common approach is to manually write signed requests for the Liblib open platform, poll generateUuid yourself, and then upload the resulting image back to the Feishu conversation. This chain is long and prone to missing steps. Below is an introduction to the community Skill liblib-comfy-fusion on SkillHub: it encapsulates the submission, polling, and local/URL input parameters of the LiblibAI ComfyUI Application API into a reusable workflow, and defines specific output conventions for Feishu attachments and image URLs in messages.
What is this¶
liblib-comfy-fusion (Coordinates: @user_7eb79720/liblib-comfy-fusion, Version 1.0.1, Category design-media, Source community, Publisher user_7eb79720) is an Agent Skill based on the universal SKILL.md format. It calls the Liblib ComfyUI application interface via AccessKey / SecretKey signatures to generate product background fusion images. It is suitable for Agents to automatically select when requirements such as “Liblib Comfy generation, Feishu image fusion, local or URL image input, querying tasks via generateUuid, or extracting image links from Feishu messages” arise in a conversation.
The SkillHub page indicates requires_api_key=true; Liblib API keys must be configured before use.
Core Features¶
Based on the Skill description and accompanying scripts, the verified capabilities include:
- Public Image URL Input: Submit tasks using a Liblib-fetchable
https://...URL as theLoadImageinput. - Local File Input: By default, upload to R2 (S3 compatible) first to obtain a public URL, then pass it to Liblib; optionally, supports
data-urimode (only if accepted by the Liblib side). - Feishu Scenarios: Extracts the first
http(s)URL from Feishu message text; for local attachments, recommends the workflow “R2 public URL → Liblib → Result returned viaMEDIA:line” so the channel can display the image directly. - Asynchronous Tasks: Obtains
generateUuidafter submission, polls untilgenerateStatusis 5 (Success) or 6 (Failed), and readsimages[].imageUrl. - CLI:
scripts/liblib_client.pyprovidesrunandstatussubcommands. Upon success, it can download results toworkspace/outputs/images/YYYY-MM-DD/and output theMEDIA:...relative path to stdout.
The underlying API base address is https://openapi.liblibai.cloud. The submission path is POST /api/generate/comfyui/app, and the status path is POST /api/generate/comfy/status. Authentication query parameters include AccessKey, Signature, Timestamp, and SignatureNonce. The signature is generated by performing HMAC-SHA1 on uriPath & Timestamp & SignatureNonce followed by URL-safe Base64 encoding (removing the trailing =).
Installation and Activation¶
First, perform a CLI check, then install the Skill into the current Agent’s skills directory (the Agent will not load it if installed in the wrong directory).
- Confirm that the SkillHub CLI is installed:
command -v skillhub && skillhub --version
If not installed, follow the SkillHub Installation Instructions to run the official installation script.
- Install this Skill (
--dirmust point to the skills directory of the current environment):
skillhub install @user_7eb79720/liblib-comfy-fusion --dir <skills directory>
Common path examples (subject to official installation documentation):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
Restart or refresh the Agent after installation to enable the Skill.
- Configure environment variables (Liblib is required; uploading local images via R2 also requires R2-related variables, which can be overridden by CLI arguments):
export LIB_ACCESS_KEY="Your Liblib AccessKey"
export LIB_SECRET_KEY="Your Liblib SecretKey"
# Used when local files are converted to public URLs via R2 by default (example names subject to SKILL)
export R2_ENDPOINT="..."
export R2_ACCESS_KEY="..."
export R2_SECRET_KEY="..."
export R2_BUCKET="..."
export PUBLIC_URL_BASE="..."
The default values for the Comfy workflow within the script include placeholders such as YOUR_TEMPLATE_UUID. During deployment, you need to replace them with your application templates on the Liblib side (see the constants at the top of scripts/liblib_client.py or runtime parameters).
Local mode depends on Python 3 and requests; the R2 upload path requires boto3.
Typical Usage¶
Invoke the client within the Skill directory (paths are relative to the installed @user_7eb79720/liblib-comfy-fusion):
Direct generation via public URL:
python3 scripts/liblib_client.py run --image-url "https://example.com/input.jpg"
Local attachments sent via Feishu (R2 first, then Liblib):
python3 scripts/liblib_client.py run --local-image "/path/to/input.png" --basename "product-fusion"
Fetch image link from Feishu message text:
python3 scripts/liblib_client.py run --feishu-text "Please process this image https://example.com/input.jpg"
Submit only, do not poll:
python3 scripts/liblib_client.py run --local-image "./input.jpg" --no-poll
Query by Task ID:
python3 scripts/liblib_client.py status <generateUuid>
Upon success (generateStatus=5), the result will be saved to workspace/outputs/images/Date/; a line MEDIA:./outputs/images/... will be output to stdout to facilitate display in the current session by the OpenClaw Feishu channel. The complete JSON is output to stderr. If the channel does not support MEDIA:, the description mentions that you can switch to upload methods like feishu-uploader (you need to possess the corresponding Skill yourself).
In clients like Cursor, you can also directly describe the requirement in natural language (e.g., “Use Liblib to fuse this product image into a background, the image is at…”), and the Agent will call the above scripts and environment variables according to the Skill’s guidance.
Use Cases and Notes¶
Who is it for
- Teams that have already enabled the ComfyUI Application API on Liblib and need to fix “signature + submission + polling + saving” into executable steps for an Agent.
- Scenarios in Feishu collaboration where product images are frequently received, and there is a desire for the Agent to automatically fuse backgrounds and return images to the group chat.
Limitations and Notes
- Input URLs must be publicly accessible by the Liblib server; local files depend on R2 and a correctly configured
PUBLIC_URL_BASEby default. - The returned
imageUrlis mostly a temporary link (approx. 7 days according to the description); if long-term retention is needed, please download or transfer it yourself. - If content moderation fails, you need to change the image or URL and retry.
- SkillHub Statistics (based on crawled data): Rating 100000, Downloads 1004, Installs 20; maintained by the community, upgrades and tickets are subject to the SkillHub page.
Conclusion¶
liblib-comfy-fusion encapsulates the product background fusion workflow of the Liblib ComfyUI Application API into a single Skill: key signatures, task polling, URL/local/Feishu inputs, and MEDIA: returns all have corresponding conventions. If you are looking for a Liblib integration in the design-media category on SkillHub that requires an API Key, you can install and try it from the official page.
- SkillHub Page: https://www.skillhub.cn/skills/user_7eb79720/liblib-comfy-fusion
- API Coordinates Page: https://api.skillhub.cn/user_7eb79720/liblib-comfy-fusion