名称: runware
描述: 通过 Runware API 生成图像和视频。可访问 FLUX、Stable Diffusion、Kling AI 等顶级模型。支持文生图、图生图、图像超分、文生视频和图生视频。适用于生成图像、根据提示词或图像创建视频、放大图像或进行 AI 图像转换。
通过 Runware 的统一 API 生成图像和视频。可访问 FLUX、Stable Diffusion XL、Kling AI 等模型。
设置 RUNWARE_API_KEY 环境变量,或在运行脚本时通过 --api-key 参数传入。
获取 API 密钥:https://runware.ai
python3 scripts/image.py gen "赛博朋克城市日落,霓虹灯,雨景" --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)
对现有图像进行风格转换:
python3 scripts/image.py img2img ./photo.jpg "水彩画风格" --strength 0.7
--strength:转换强度(0=保持原图,1=完全忽略原图)python3 scripts/image.py upscale ./small.png --factor 4 -o ./large.png
python3 scripts/image.py models
python3 scripts/video.py gen "一只猫在玩毛线球,可爱,高质量" --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:轮询超时时间(默认:600秒)
为单张图像生成动画,或在两张图像间进行插帧:
# 单张图像(作为视频首帧)
python3 scripts/video.py img2vid ./start.png --prompt "缓慢拉远镜头" -o ./animated.mp4
# 两张图像(作为视频首尾帧)
python3 scripts/video.py img2vid ./start.png ./end.png --duration 5
python3 scripts/video.py models
| 模型 | ID |
|---|---|
| FLUX.1 Dev | runware:101@1 |
| FLUX.1 Schnell(快速版) | 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