Smart Image Generation
Paste the following prompt into your AI chat to install this skill:
Please install @ixhlink/ixhlink-skills-image-gen using https://skillhub.cn/install/skillhub.md.
About this skill
What Problem It Solves
When an agent needs image generation, calling upstream models directly often creates practical issues: image_generation is usually a slow task, so results cannot be returned synchronously; fields such as prompt, size, n, and quality can vary by upstream model; reference-image generation may require b64 or url; and some calls hit a 402 payment gate. ixhlink-skills-image-gen consolidates this API behavior behind one skill entry point, so callers focus on business parameters, task state, and image output.
How It Works
The main workflow is asynchronous. You can first check that the model is enabled via GET /api/v1/llm/models, then submit POST /api/v1/llm/invoke. The request body includes prompt and optional size, n, quality, response_format, and images. After success, read data.task.id and poll GET /api/v1/llm/tasks/{task_id} at 2-5 second intervals until status = succeeded. Image URLs appear in data.result.data[].url. If the first call returns 402, retry with the same JSON body and include WeixinPay-Required and X-Payment-Id. You can also create an async task directly, keeping the same request body.
Boundaries
It fits text-to-image, reference-image generation, and per-call billing. Do not modify business fields in payload during payment retries; pass order parameters via headers or the payment object. An unenabled model may return 404, an unavailable upstream site may return 503, and failed tasks should be inspected via data.error_message. Set timeouts according to your workload, for example 3-5 minutes.
Use Cases
- Generate a 1024x1024 illustration and return accessible image URLs.
- Keep brand style with reference images in agent asset generation.
- Check model status, 402 payment flow, and task failures.
- Show 0.3 yuan per call, collect payment, and retry unchanged.
Best For
- Agent workflow engineers wiring image tasks and polling result URLs.
- Billing engineers handling 402 responses and payment retries.
- Design engineers generating brand assets with reference images.
- Platform architects checking model status, errors, and timeouts.
Related Skills
Enter a material name to get preview and download links for free, commercially usable video assets, with paid platform options, pricing, and search suggestions when results are limited.
Restyle a short video into a new visual style while preserving core elements such as characters, actions, and composition, suitable for various creative conversions like anime, illustration, ink wash, etc.
Create Douyin vertical video covers from topics, hooks, or materials with support for creative generation, image synthesis, and refinement.
An AI tool that transforms real photos into specified illustration styles while preserving subject recognition.