$npx -y skills add berabuddies/Semia --skill mulerouter-skillsGenerates images and videos using MuleRouter or MuleRun multimodal APIs. Text-to-Image, Image-to-Image, Text-to-Video, Image-to-Video, video editing (VACE, keyframe interpolation). Use when the user wants to generate, edit, or transform images and videos using AI models like Wan2
| 1 | # MuleRouter API |
| 2 | |
| 3 | Generate images and videos using MuleRouter or MuleRun multimodal APIs. |
| 4 | |
| 5 | ## Configuration Check |
| 6 | |
| 7 | Before running any commands, verify the environment is configured: |
| 8 | |
| 9 | ### Step 1: Check for existing configuration |
| 10 | |
| 11 | ```bash |
| 12 | # Check environment variables |
| 13 | echo "MULEROUTER_BASE_URL: $MULEROUTER_BASE_URL" |
| 14 | echo "MULEROUTER_SITE: $MULEROUTER_SITE" |
| 15 | echo "MULEROUTER_API_KEY: ${MULEROUTER_API_KEY:+[SET]}" |
| 16 | |
| 17 | # Check for .env file |
| 18 | ls -la .env 2>/dev/null || echo "No .env file found" |
| 19 | ``` |
| 20 | |
| 21 | ### Step 2: Configure if needed |
| 22 | |
| 23 | **Option A: Environment variables with custom base URL (highest priority)** |
| 24 | ```bash |
| 25 | export MULEROUTER_BASE_URL="https://api.mulerouter.ai" # or your custom API endpoint |
| 26 | export MULEROUTER_API_KEY="your-api-key" |
| 27 | ``` |
| 28 | |
| 29 | **Option B: Environment variables with site (used if base URL not set)** |
| 30 | ```bash |
| 31 | export MULEROUTER_SITE="mulerun" # or "mulerouter" |
| 32 | export MULEROUTER_API_KEY="your-api-key" |
| 33 | ``` |
| 34 | |
| 35 | **Option C: Create .env file** |
| 36 | |
| 37 | Create `.env` in the current working directory: |
| 38 | |
| 39 | ```env |
| 40 | # Option 1: Use custom base URL (takes priority over SITE) |
| 41 | MULEROUTER_BASE_URL=https://api.mulerouter.ai |
| 42 | MULEROUTER_API_KEY=your-api-key |
| 43 | |
| 44 | # Option 2: Use site (if BASE_URL not set) |
| 45 | # MULEROUTER_SITE=mulerun |
| 46 | # MULEROUTER_API_KEY=your-api-key |
| 47 | ``` |
| 48 | |
| 49 | **Note:** `MULEROUTER_BASE_URL` takes priority over `MULEROUTER_SITE`. If both are set, `MULEROUTER_BASE_URL` is used. |
| 50 | |
| 51 | **Note:** The tool only reads `.env` from the current directory. Run scripts from the skill root (`skills/mulerouter-skills/`). |
| 52 | |
| 53 | ### Step 3: Using `uv` to run scripts |
| 54 | |
| 55 | The skill uses `uv` for dependency management and execution. Make sure `uv` is installed and available in your PATH. |
| 56 | |
| 57 | Run `uv sync` to install dependencies. |
| 58 | |
| 59 | ## Quick Start |
| 60 | |
| 61 | ### 1. List available models |
| 62 | |
| 63 | ```bash |
| 64 | uv run python scripts/list_models.py |
| 65 | ``` |
| 66 | |
| 67 | ### 2. Check model parameters |
| 68 | |
| 69 | ```bash |
| 70 | uv run python models/alibaba/wan2.6-t2v/generation.py --list-params |
| 71 | ``` |
| 72 | |
| 73 | ### 3. Generate content |
| 74 | |
| 75 | **Text-to-Video:** |
| 76 | ```bash |
| 77 | uv run python models/alibaba/wan2.6-t2v/generation.py --prompt "A cat walking through a garden" |
| 78 | ``` |
| 79 | |
| 80 | **Text-to-Image:** |
| 81 | ```bash |
| 82 | uv run python models/alibaba/wan2.6-t2i/generation.py --prompt "A serene mountain lake" |
| 83 | ``` |
| 84 | |
| 85 | **Image-to-Video:** |
| 86 | ```bash |
| 87 | uv run python models/alibaba/wan2.6-i2v/generation.py --prompt "Gentle zoom in" --image "https://example.com/photo.jpg" #remote image url |
| 88 | ``` |
| 89 | ```bash |
| 90 | uv run python models/alibaba/wan2.6-i2v/generation.py --prompt "Gentle zoom in" --image "/path/to/local/image.png" #local image path |
| 91 | ``` |
| 92 | |
| 93 | ## Image Input |
| 94 | |
| 95 | For image parameters (`--image`, `--images`, etc.), **prefer local file paths** over base64. |
| 96 | |
| 97 | ```bash |
| 98 | # Preferred: local file path (auto-converted to base64) |
| 99 | --image /tmp/photo.png |
| 100 | |
| 101 | --images ["/tmp/photo.png"] |
| 102 | ``` |
| 103 | |
| 104 | The skill automatically converts local file paths to base64 before sending to the API. This avoids command-line length limits that occur with raw base64 strings. |
| 105 | |
| 106 | ## Workflow |
| 107 | |
| 108 | 1. Check configuration: verify `MULEROUTER_BASE_URL` or `MULEROUTER_SITE`, and `MULEROUTER_API_KEY` are set |
| 109 | 2. Install dependencies: run `uv sync` |
| 110 | 3. Run `uv run python scripts/list_models.py` to discover available models |
| 111 | 4. Run `uv run python models/<path>/<action>.py --list-params` to see parameters |
| 112 | 5. Execute with appropriate parameters |
| 113 | 6. Parse output URLs from results |
| 114 | |
| 115 | ## Tips |
| 116 | 1. For an image generation model, a suggested timeout is 5 minutes. |
| 117 | 2. For a video generation model, a suggested timeout is 15 minutes. |
| 118 | |
| 119 | ## References |
| 120 | |
| 121 | - [REFERENCE.md](references/REFERENCE.md) - API configuration and CLI options |
| 122 | - [MODELS.md](references/MODELS.md) - Complete model specifications |