maliang-image

Generate images from text prompts or edit existing images with AI. Powered by Google Gemini via Maliang API. Free $6 credit on first use (~10 images). Supports text-to-image and multi-image inpainting editing.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "maliang-image" with this command: npx skills add xexojay/maliang-image

Maliang Image — AI Image Generation & Editing

Provider: Maliang API (nano.djdog.ai) Model: Google Gemini (image generation & editing) Pricing: $0.60/image, free $6 credit on first use (~10 images)

What it does

Generate images from text descriptions or edit existing images using AI.

  • No images provided → text-to-image generation
  • Images provided → AI image editing / inpainting (1–10 reference images, user-provided only)

Security & Data Handling

  • API Key: Auto-provisioned on first use via POST /api/v1/provision. The key is stored only in your local environment (MALIANG_API_KEY). You can revoke it at any time.
  • Images: Only images explicitly provided by the user are sent to the API. The skill never reads files unless the user specifies the file path. All uploads go over HTTPS.
  • No data collection: The API processes your request and returns results. Images are not stored permanently on the server.

Inputs needed

InputSourceRequired
Text promptUser messageYES
Reference imagesUser provides file paths or URLsNO (if omitted, generates from text)
Aspect ratioUser preferenceNO (default: 1:1)

Auto-Provision (First-time Setup)

On first use (when MALIANG_API_KEY is not set), automatically provision a new account:

curl -s -X POST "https://nano.djdog.ai/api/v1/provision"

Response:

{
  "success": true,
  "data": {
    "api_key": "sk-...",
    "short_code": "ML-XXXXXX",
    "balance": 6.0,
    "currency": "USD",
    "recharge_url": "https://nano.djdog.ai/recharge/ML-XXXXXX",
    "message": "Your API key has been created with $6 initial credit (~10 images)..."
  }
}

Save the returned api_key as MALIANG_API_KEY for all subsequent requests. Tell the user their short code (ML-XXXXXX) and initial balance — they'll need the short code to recharge later.

Balance Check

After each task, check remaining balance:

curl -s "https://nano.djdog.ai/api/v1/balance" \
  -H "Authorization: Bearer ${MALIANG_API_KEY}"

Response includes short_code for recharge reference. If balance is low, remind the user:

Your balance is $X.XX. To recharge, visit: https://nano.djdog.ai/recharge/{short_code}

Workflow

Step 0 — Ensure API key

If MALIANG_API_KEY is not set, run Auto-Provision first (see above) and store the returned key.

Step 1 — Determine mode

  • If the user provides one or more images (file paths, URLs, or pasted base64): edit mode
  • Otherwise: generate mode

Step 2 — Prepare images (edit mode only)

For each image the user provides:

  1. If it is a local file path, read and base64-encode it.
  2. If it is a URL, download it first, then base64-encode.
  3. Strip any data:image/...;base64, prefix — the API accepts raw base64.
  4. Verify each image is under 10 MB after decoding.
  5. Maximum 10 images total.

Step 3 — Submit task

Generate mode — call:

curl -s -X POST "https://nano.djdog.ai/api/v1/generate" \
  -H "Authorization: Bearer ${MALIANG_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "<user prompt>",
    "aspect_ratio": "<ratio, default 1:1>"
  }'

Edit mode — call:

curl -s -X POST "https://nano.djdog.ai/api/v1/edit" \
  -H "Authorization: Bearer ${MALIANG_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "<user editing instruction>",
    "image": "<base64 string or array of base64 strings>",
    "aspect_ratio": "<ratio, optional>"
  }'

Both return:

{
  "success": true,
  "data": {
    "task_id": "...",
    "status": "pending",
    "created_at": "..."
  }
}

Extract task_id from the response.

Step 4 — Poll for result

Poll every 3 seconds, up to 120 seconds max:

curl -s "https://nano.djdog.ai/api/v1/tasks/${TASK_ID}" \
  -H "Authorization: Bearer ${MALIANG_API_KEY}"

Response data.status values:

StatusMeaningAction
pendingQueuedKeep polling
processingGeneratingKeep polling
completedDoneGet image from image_url or image_base64
failedErrorShow error.message to user
deadMax retries exceededShow error, suggest retry

Step 5 — Deliver result

When status is completed:

  • If image_url is present: show the URL to the user (preferred).
  • If only image_base64 is present: save to a local file and show the path.

Output format

Image generated successfully!
URL: https://...
Aspect ratio: 1:1
Prompt: "<original prompt>"

Guardrails

  • Never fabricate task IDs or image URLs. Only use values from API responses.
  • Never poll more than 40 times (120 seconds). If not completed, tell the user it is still processing and provide the task ID for manual checking.
  • Do not send images larger than 10 MB to the edit endpoint.
  • Do not send more than 10 images to the edit endpoint.
  • If the API returns 402 (INSUFFICIENT_BALANCE), tell the user their balance is low and they need to recharge.
  • Prompt max length is 4000 characters. If the user's prompt is longer, ask them to shorten it.

Failure handling

ErrorAction
401 UnauthorizedMALIANG_API_KEY is invalid or missing. Try re-provisioning a new account.
402 Insufficient BalanceTell user to recharge via https://nano.djdog.ai/recharge/{short_code} (get short_code from balance endpoint)
400 IMAGE_TOO_LARGETell user the image exceeds 10 MB limit
400 TOO_MANY_IMAGESTell user max 10 images allowed
Network errorRetry once, then report failure
Timeout (120s)Report task ID, suggest checking later

Examples

Text-to-image:

User: Generate a cute orange cat sitting on a windowsill at sunset, anime style
→ Auto-provision if no API key → POST /api/v1/generate with prompt → poll for result → return image URL

Image editing:

User: Change the background of this photo to a beach scene [attaches photo]
→ Base64-encode the photo
→ POST /api/v1/edit with prompt + image, poll for result, return image URL

Multi-image editing:

User: Combine these character designs into one group portrait [attaches 3 images]
→ Base64-encode all 3 images
→ POST /api/v1/edit with prompt + image array, poll for result, return image URL

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

电商直播贴片生成器 / Ecommerce Livestream Overlay Generator

电商直播贴片生成器 / 电商直播视觉包装工具。 适用于淘宝直播、抖音直播带货、拼多多直播、快手直播等电商直播场景。 输入品牌、产品、促销信息或产品照片,自动生成完整电商直播视觉包装: 背景、标题栏、主播形象、价格卡、产品货架、福利条、促销贴片。 支持绿幕抠图、自动合成预览、打包交付。 E-commerce liv...

Registry SourceRecently Updated
2061Profile unavailable
General

BigModel Image Video Generator

使用 BigModel (CogView/CogVideoX) API 生成高质量图片和视频。当用户需要"生成图片"、"制作视频"、"AI 绘画"、"创建封面"、"设计海报"、"视觉内容生成"、或任何需要创建图像/视频内容的场景时使用此技能。即使没有明确提到"生成",只要用户需要创建、设计或制作视觉内容(如小说封...

Registry SourceRecently Updated
930Profile unavailable
General

Nano Banana Pro

Generate or edit AI images with the NanoPhoto.AI Nano Banana Pro API. Use when: (1) User wants text-to-image generation from a prompt, (2) User wants image-t...

Registry SourceRecently Updated
1.6K3Profile unavailable
General

NK Images Search

Search 1+ million free high-quality AI stock photos. Generate up to 240 free AI images daily. No API key, no tokens, no cost. 235+ niches and growing.

Registry SourceRecently Updated
2K10Profile unavailable