AI Agent Hub
Back to skills
JiMeng CLI Text-to-Image icon

JiMeng CLI Text-to-Image

Design & Media Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_c1d16043/jimeng-cli-text2image.

About this skill

The Problem It Solves

When building automated workflows or intelligent agent applications, there is often a need for a reliable, programmable method to generate images. Interacting directly with an image generation model's API involves complex authentication, parameter validation, and state management. This skill encapsulates the JiMeng text-to-image capability into a standardized Command-Line Interface (CLI), allowing you to integrate image generation into terminals, scripts, or any environment that supports CLI invocation via the dreamina text2image command. This lets you focus on business logic rather than underlying protocols.

How the Skill Works

The core of this skill is providing a parameter contract and operational guide for the dreamina text2image command. The workflow is primarily divided into three stages:

  1. Validation and Preparation: Before submitting a task, run dreamina text2image -h to confirm the parameters, models (e.g., 5.0Pro), and resolution matrix supported by the current CLI version. This ensures your command is valid both syntactically and by business rules.
  2. Task Submission: Construct and submit the generation request. This is a critical step where you must explicitly specify --resolution_type=1k|2k|4k, and ensure that --width and --height are provided as a pair of positive integers and cannot be used simultaneously with the --ratio parameter. The submission command consumes account credits and returns a submit_id, which is the unique identifier for subsequent queries.
  3. Polling and Result Retrieval: Use the submit_id to repeatedly call the query command. The status progresses from querying (received) to a final state of either success or fail. On success, you can specify --download_dir to download the generated files. On failure, the fail_reason is reported for diagnostics.

Boundaries and Key Considerations

Please clearly understand the scope and constraints of this skill:
- Text-to-Image Only: This skill should not be used for image-to-image, video generation, or pure prompt creation. Dedicated skills like jimeng-cli-image2image or jimeng-prompt-* exist for those scenarios.
- Parameter Rules are Mandatory: --resolution_type is a required parameter (per v1.4.15 rules); omitting it will cause the request to be rejected. Additionally, custom width/height and preset aspect ratio (--ratio) are mutually exclusive.
- Model Identifier is a Token: In commands, the model name must use its token format (e.g., 5.0Pro), not the human-readable display name (e.g., 5.0 Pro).
- Understand Asynchronous Status: A status of querying means the task has been received but is not the final success state. You must continue polling until an explicit success or fail is returned.
- Credit Consumption: Each successful submission consumes credits. This cost should be clearly communicated to the user prior to the operation.

Use Cases

  • When a marketing team needs to programmatically generate product visuals or ad creatives via an automation script, submitting requests with specific parameters and handling the asynchronous polling for results.
  • For a prompt engineer working extensively in a terminal, who needs to rapidly test various prompts, models (e.g., `5.0Pro`), and resolution settings to compare image outputs efficiently.
  • During the integration of image generation into a larger data pipeline, where a reliable CLI command with clear submission IDs and success/failure states is required for orchestration.

Best For

  • Backend engineers developing an image generation module for an intelligent agent or internal toolchain, who need a reliable CLI interface instead of raw API calls.
  • Developers or researchers who prefer working in the terminal for efficiency and need to rapidly generate and test image prompts directly from the command line or within scripts.
  • System architects who need to embed image generation into automated pipelines (like content factories or data visualization) and require that step to have asynchronous processing and robust error feedback.