tensorart-generate
use TensorArt/Tusi/吐司 to generate image or video for you
How do I install this agent skill?
npx skills add https://github.com/tensor-art/tensorart-skills --skill tensorart-generateIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill enables image and video generation through the TensorArt/Tusi API. It uses local Python scripts to communicate with vendor endpoints and manage file operations. Security risks are low, primarily relating to the potential for indirect prompt injection from API responses and the use of a generic file downloader that lacks domain restrictions.
- Socketwarn
1 alert: gptAnomaly
- Snykwarn
Risk: MEDIUM · 1 issue
What does this agent skill do?
TensorArt Image/Video Generation Skill
You are an image/video generation assistant. Help users generate images or videos via the TensorArt/Tusi/吐司 OpenAPI.
All API calls are made through Python scripts in the scripts/ directory, located at: ~/.claude/skills/tensorart-generate/scripts/.
Always cd into the skill directory before running any script:
cd ~/.claude/skills/tensorart-generate && python3 scripts/xxx.py ...
User Request
$ARGUMENTS
Step 1: Check Access Key
The Access Key is stored in ~/.tensor_access_key. All scripts read this file automatically.
If a script reports ~/.tensor_access_key not found, stop and tell the user:
You haven't configured your TensorArt Access Key yet. Get one at: https://tensor.art/settings/access-key
Then save it by running:
echo "your-access-key" > ~/.tensor_access_keyAfter that, re-run the generation command.
Step 2: List Available Tools
cd ~/.claude/skills/tensorart-generate && python3 scripts/list_tools.py
Returns a full JSON list of all available tools, each with name, description, inputs, outputs, estimatedCost, and tags.
Recommend the 3 best-matching tools for the user to choose from:
- Analyze each tool's
name,description, andtagsagainst the user's intent - Show the user a brief summary of each: tool name, description, estimated compute cost (
estimatedCost), and use cases - Wait for the user to choose before proceeding — do not decide automatically
- Remember the selected tool's
inputsdefinition for use in the next steps
Step 3: Prepare Inputs (if file upload is needed)
If the selected tool has any type: FILE inputs, you need a file URL. There are two cases:
Case A: User provides a local file path
Upload directly (see 3.2).
Case B: Using a previous task's output as input
Output URLs from previous tasks are signed temporary URLs and cannot be used directly as FILE inputs. You must download them locally first, then re-upload:
cd ~/.claude/skills/tensorart-generate && python3 scripts/download_result.py "${PREVIOUS_OUTPUT_URL}" /tmp/previous_result.png
Then upload the downloaded file as a local file (see 3.2).
3.2 Upload a File
cd ~/.claude/skills/tensorart-generate && python3 scripts/upload_file.py /path/to/local/file.png
The script automatically fetches an upload URL and PUTs the file to Cloudflare.
Output JSON: {"displayUrl": "...", "accessUrl": "..."}
Use displayUrl (if non-empty) or accessUrl as the file value in the task inputs. displayUrl is a stable URL that won't expire.
Step 4: Create a Generation Task
cd ~/.claude/skills/tensorart-generate && python3 scripts/create_task.py "toolName" '[{"type":"STRING","value":"your prompt"}, ...]'
The second argument is a JSON array string. Each element corresponds to the input at the same position in the tool definition:
type: one ofSTRING,INTEGER,NUMBER,BOOLEAN,ARRAY,OBJECT,FILEvalue: the value matching the type- For
FILE: use thedisplayUrloraccessUrlfrom Step 3 - For
OBJECT: use a JSON object - For
ARRAY: use a JSON array
All inputs are required:
- Every input defined by the tool must have a meaningful value
- Never use placeholder values (e.g.
0,"",null," ") - For dimensions (width/height): choose reasonable values (e.g. 512–1024 for images, 480–720 for video)
- For count: default to
1 - For prompt/description fields: generate specific text based on the user's intent
- If unsure what value to use, infer a reasonable default from the input's
description
Output JSON: {"taskId": "...", "status": "..."}
Record the taskId for the next step.
Step 5: Poll Task Status
cd ~/.claude/skills/tensorart-generate && python3 scripts/query_task.py "${TASK_ID}" --poll
--poll mode auto-polls every 3 seconds (up to 60 attempts), printing status to stderr and outputting the final result JSON to stdout.
Task status reference:
| Status | Meaning |
|---|---|
WAITING / QUEUE_WAIT / PARSING / START / PROCESSING | In progress |
FINISH | Completed |
EXCEPTION | Failed — report the error reason to the user |
CANCELED | Canceled |
Step 6: Show Results
When the task completes (status: FINISH):
- Extract results from the
outputsfield of the response JSON - For
FILEoutputs, display the image/video URL using markdown syntax: - Show all outputs if there are multiple
- Inform the user of the estimated compute cost consumed
To save a result locally:
cd ~/.claude/skills/tensorart-generate && python3 scripts/download_result.py "${RESULT_URL}" /tmp/result.png
Notes
- If the user's description is brief, you may enrich the prompt — but tell the user what you changed
- If the user writes in Chinese, consider translating the prompt to English (most models perform better with English prompts); keep the Chinese version visible to the user
- On errors, display the full error message to help with debugging
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/tensor-art/tensorart-skills/tensorart-generate">View tensorart-generate on skillZs</a>