Jimeng (Dreamina) Skill
Generate images or videos using Jimeng CLI
【Important Concurrency Limit】: Jimeng can run a maximum of 3 concurrent queuing or generating tasks!
Default Preference Order
User requirements always take precedence. When there are no specific requirements from the user, follow the default preference order below.
Image Generation
- Model preference order (model_version): 4.6 > 4.5 > 5.0 > 4.0
- Resolution (resolution_type): 2k
Video Generation
- Model preference order (model_version): seedance2.0 > seedance2.0fast
- Resolution (video_resolution): 720p
General (Image + Video Generation)
- Aspect ratio (ratio) preference order: 16:9 > 9:16 > 1:1
Initialization
1. Check status and credits first
If the command is not found, install it first:
bash
curl -fsSL https://jimeng.jianying.com/cli | bash
If you are not logged in, run
to sign in. This command will launch your local browser to obtain login credentials.
2. View all features
Generate from text prompt file
All image and video generation commands support reading prompts from local text files:
bash
dreamina text2image --prompt "$(cat prompt.txt)" --ratio 16:9
dreamina text2video --prompt "$(cat prompt.txt)"
dreamina multimodal2video --prompt "$(cat prompt.txt)"
Image Generation
Image generation is relatively fast, you can generate directly:
bash
dreamina text2image --prompt "your prompt" --ratio 16:9
After generation is complete, just download it to your local machine.
Video Generation (Asynchronous Task + Progress Polling)
Video generation usually takes a long time. After submitting a task, a
will be returned, and you need to get the task progress and queuing status through regular polling.
1. Submit video generation task
View specific subcommand help:
bash
dreamina multimodal2video --help
# or
dreamina text2video --help
After submitting the task,
and current queuing position will be returned. Please save the
for subsequent progress polling queries.
2. Query task status and poll
Use the following command to query task status regularly:
bash
dreamina query_result --submit_id <submit_id>
This command returns:
- Current task status
- Queuing position/queuing progress
- If completed, the download URL of the generated result
3. Regular polling process
Since video generation takes a long time, you need to poll once per minute:
bash
# Query status every minute
while true; do
echo "=== $(date) ==="
dreamina query_result --submit_id <submit_id>
echo
sleep 60
done
After the task is completed, extract the download URL from the returned result, use curl to download and specify a semantic file name:
bash
curl -o "output.mp4" "<download_url>"
4. Queuing progress and waiting time estimation
Estimate based on the actual queue consumption speed:
- Record the time difference of each poll and the change in queuing position
- Calculate the average number of positions the queue advances per minute
- Divide the current remaining queuing positions by the advance speed to get the estimated number of minutes left until queuing ends
- Just inform the user of these two pieces of information
Common Subcommands (Use these first)
- : Generate images from prompts
- : Generate images with multiple reference images
- : Text to video
dreamina multimodal2video
: All-in-one reference video generation (supports image reference + text prompt)
- : Query asynchronous task status (required for video generation)
- : List submitted tasks and their status
- : Check remaining credits
Download Resources
- Use to download and specify a semantic file name:
Example
bash
curl -o "semantic-filename.mp4" "<download_url>"
Error Handling
If you encounter a generation error, tell the user the specific error information and guide the user to resolve the error.