ClawSkills logoClawSkills

Runware Image & Video generation

通过 Runware API 生成图像和视频。访问 FLUX、Stable Diffusion、Kling AI 和其他顶级模型。支持文生图、图生图、放大、

介绍

# Runware

通过 Runware 的统一 API 生成图像和视频。访问 FLUX、Stable Diffusion XL、Kling AI 等模型。

## 设置

设置 `RUNWARE_API_KEY` 环境变量,或将 `--api-key` 传递给脚本。

获取 API Key: https://runware.ai

## 图像生成

### Text-to-Image(文生图)

```bash python3 scripts/image.py gen "a cyberpunk city at sunset, neon lights, rain" --count 2 -o ./images ```

选项: - `--model`:模型 ID(默认:`runware:101@1` / FLUX.1 Dev) - `--width/--height`:尺寸(默认:1024x1024) - `--steps`:推理步数(默认:25) - `--cfg`:CFG 比例(默认:7.5) - `--count/-n`:图像数量 - `--negative`:反向提示词 - `--seed`:可复现的随机种子 - `--lora`:LoRA 模型 ID - `--format`:png/jpg/webp

### Image-to-Image(图生图)

转换现有图像:

```bash python3 scripts/image.py img2img ./photo.jpg "watercolor painting style" --strength 0.7 ```

- `--strength`:转换强度(0=保留原图,1=忽略原图)

### 放大(Upscale)

```bash python3 scripts/image.py upscale ./small.png --factor 4 -o ./large.png ```

### 列出模型

```bash python3 scripts/image.py models ```

## 视频生成

### Text-to-Video(文生视频)

```bash python3 scripts/video.py gen "a cat playing with yarn, cute, high quality" --duration 5 -o ./cat.mp4 ```

选项: - `--model`:模型 ID(默认:`klingai:5@3` / Kling AI 1.6 Pro) - `--duration`:时长(秒) - `--width/--height`:分辨率(默认:1920x1080) - `--negative`:反向提示词 - `--format`:mp4/webm/mov - `--max-wait`:轮询超时时间(默认:600s)

### Image-to-Video(图生视频)

让图像动起来或在帧之间进行插值:

```bash # Single image (becomes first frame) python3 scripts/video.py img2vid ./start.png --prompt "zoom out slowly" -o ./animated.mp4

# Two images (first and last frame) python3 scripts/video.py img2vid ./start.png ./end.png --duration 5 ```

### 列出视频模型

```bash python3 scripts/video.py models ```

## 热门模型

### 图像 | 模型 | ID | |-------|-----| | FLUX.1 Dev | `runware:101@1` | | FLUX.1 Schnell (fast) | `runware:100@1` | | FLUX.1 Kontext | `runware:106@1` | | Stable Diffusion XL | `civitai:101055@128080` | | RealVisXL | `civitai:139562@297320` |

### 视频 | 模型 | ID | |-------|-----| | Kling AI 1.6 Pro | `klingai:5@3` | | Kling AI 1.5 Pro | `klingai:3@2` | | Runway Gen-3 | `runwayml:1@1` |

浏览所有模型: https://runware.ai/models

## 注意事项

- 视频生成是异步的;脚本会轮询直到完成 - 费用因模型而异 — 请查看 https://runware.ai/pricing - FLUX 模型在质量方面表现出色;Schnell 速度更快 - 为获得最佳视频效果,请使用包含动作描述的提示词

更多产品