varg.ai-sdk 0.1.1 → 0.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +1 -1
- package/.env.example +3 -0
- package/.github/workflows/ci.yml +23 -0
- package/.husky/README.md +102 -0
- package/.husky/commit-msg +6 -0
- package/.husky/pre-commit +9 -0
- package/.husky/pre-push +6 -0
- package/.size-limit.json +8 -0
- package/.test-hooks.ts +5 -0
- package/CLAUDE.md +10 -3
- package/CONTRIBUTING.md +150 -0
- package/LICENSE.md +53 -0
- package/README.md +56 -209
- package/SKILLS.md +26 -10
- package/biome.json +7 -1
- package/bun.lock +1286 -0
- package/commitlint.config.js +22 -0
- package/docs/index.html +1130 -0
- package/docs/prompting.md +326 -0
- package/docs/react.md +834 -0
- package/docs/sdk.md +812 -0
- package/ffmpeg/CLAUDE.md +68 -0
- package/package.json +43 -10
- package/pipeline/cookbooks/scripts/animate-frames-parallel.ts +84 -0
- package/pipeline/cookbooks/scripts/combine-scenes.sh +53 -0
- package/pipeline/cookbooks/scripts/generate-frames-parallel.ts +99 -0
- package/pipeline/cookbooks/scripts/still-to-video.sh +37 -0
- package/pipeline/cookbooks/text-to-tiktok.md +669 -0
- package/pipeline/cookbooks/trendwatching.md +156 -0
- package/plan.md +281 -0
- package/scripts/.gitkeep +0 -0
- package/src/ai-sdk/cache.ts +142 -0
- package/src/ai-sdk/examples/cached-generation.ts +53 -0
- package/src/ai-sdk/examples/duet-scene-4.ts +53 -0
- package/src/ai-sdk/examples/duet-scene-5-audio.ts +32 -0
- package/src/ai-sdk/examples/duet-video.ts +56 -0
- package/src/ai-sdk/examples/editly-composition.ts +63 -0
- package/src/ai-sdk/examples/editly-test.ts +57 -0
- package/src/ai-sdk/examples/editly-video-test.ts +52 -0
- package/src/ai-sdk/examples/fal-lipsync.ts +43 -0
- package/src/ai-sdk/examples/higgsfield-image.ts +61 -0
- package/src/ai-sdk/examples/music-generation.ts +19 -0
- package/src/ai-sdk/examples/openai-sora.ts +34 -0
- package/src/ai-sdk/examples/replicate-bg-removal.ts +52 -0
- package/src/ai-sdk/examples/simpsons-scene.ts +61 -0
- package/src/ai-sdk/examples/talking-lion.ts +55 -0
- package/src/ai-sdk/examples/video-generation.ts +39 -0
- package/src/ai-sdk/examples/workflow-animated-girl.ts +104 -0
- package/src/ai-sdk/examples/workflow-before-after.ts +114 -0
- package/src/ai-sdk/examples/workflow-character-grid.ts +112 -0
- package/src/ai-sdk/examples/workflow-slideshow.ts +161 -0
- package/src/ai-sdk/file-cache.ts +112 -0
- package/src/ai-sdk/file.ts +238 -0
- package/src/ai-sdk/generate-element.ts +92 -0
- package/src/ai-sdk/generate-music.ts +46 -0
- package/src/ai-sdk/generate-video.ts +165 -0
- package/src/ai-sdk/index.ts +72 -0
- package/src/ai-sdk/music-model.ts +110 -0
- package/src/ai-sdk/providers/editly/editly.test.ts +1108 -0
- package/src/ai-sdk/providers/editly/ffmpeg.ts +60 -0
- package/src/ai-sdk/providers/editly/index.ts +817 -0
- package/src/ai-sdk/providers/editly/layers.ts +776 -0
- package/src/ai-sdk/providers/editly/plan.md +144 -0
- package/src/ai-sdk/providers/editly/types.ts +328 -0
- package/src/ai-sdk/providers/elevenlabs-provider.ts +255 -0
- package/src/ai-sdk/providers/fal-provider.ts +512 -0
- package/src/ai-sdk/providers/higgsfield.ts +379 -0
- package/src/ai-sdk/providers/openai.ts +251 -0
- package/src/ai-sdk/providers/replicate.ts +16 -0
- package/src/ai-sdk/video-model.ts +185 -0
- package/src/cli/commands/find.tsx +137 -0
- package/src/cli/commands/help.tsx +85 -0
- package/src/cli/commands/index.ts +6 -0
- package/src/cli/commands/list.tsx +238 -0
- package/src/cli/commands/render.tsx +71 -0
- package/src/cli/commands/run.tsx +511 -0
- package/src/cli/commands/which.tsx +253 -0
- package/src/cli/index.ts +114 -0
- package/src/cli/quiet.ts +44 -0
- package/src/cli/types.ts +32 -0
- package/src/cli/ui/components/Badge.tsx +29 -0
- package/src/cli/ui/components/DataTable.tsx +51 -0
- package/src/cli/ui/components/Header.tsx +23 -0
- package/src/cli/ui/components/HelpBlock.tsx +44 -0
- package/src/cli/ui/components/KeyValue.tsx +33 -0
- package/src/cli/ui/components/OptionRow.tsx +81 -0
- package/src/cli/ui/components/Separator.tsx +23 -0
- package/src/cli/ui/components/StatusBox.tsx +108 -0
- package/src/cli/ui/components/VargBox.tsx +51 -0
- package/src/cli/ui/components/VargProgress.tsx +36 -0
- package/src/cli/ui/components/VargSpinner.tsx +34 -0
- package/src/cli/ui/components/VargText.tsx +56 -0
- package/src/cli/ui/components/index.ts +19 -0
- package/src/cli/ui/index.ts +12 -0
- package/src/cli/ui/render.ts +35 -0
- package/src/cli/ui/theme.ts +63 -0
- package/src/cli/utils.ts +78 -0
- package/src/core/executor/executor.ts +201 -0
- package/src/core/executor/index.ts +13 -0
- package/src/core/executor/job.ts +214 -0
- package/src/core/executor/pipeline.ts +222 -0
- package/src/core/index.ts +11 -0
- package/src/core/registry/index.ts +9 -0
- package/src/core/registry/loader.ts +149 -0
- package/src/core/registry/registry.ts +221 -0
- package/src/core/registry/resolver.ts +206 -0
- package/src/core/schema/helpers.ts +134 -0
- package/src/core/schema/index.ts +8 -0
- package/src/core/schema/shared.ts +102 -0
- package/src/core/schema/types.ts +279 -0
- package/src/core/schema/validator.ts +92 -0
- package/src/definitions/actions/captions.ts +261 -0
- package/src/definitions/actions/edit.ts +298 -0
- package/src/definitions/actions/image.ts +125 -0
- package/src/definitions/actions/index.ts +114 -0
- package/src/definitions/actions/music.ts +205 -0
- package/src/definitions/actions/sync.ts +128 -0
- package/{action/transcribe/index.ts → src/definitions/actions/transcribe.ts} +58 -68
- package/src/definitions/actions/upload.ts +111 -0
- package/src/definitions/actions/video.ts +163 -0
- package/src/definitions/actions/voice.ts +119 -0
- package/src/definitions/index.ts +23 -0
- package/src/definitions/models/elevenlabs.ts +50 -0
- package/src/definitions/models/flux.ts +56 -0
- package/src/definitions/models/index.ts +36 -0
- package/src/definitions/models/kling.ts +56 -0
- package/src/definitions/models/llama.ts +54 -0
- package/src/definitions/models/nano-banana-pro.ts +102 -0
- package/src/definitions/models/sonauto.ts +68 -0
- package/src/definitions/models/soul.ts +65 -0
- package/src/definitions/models/wan.ts +54 -0
- package/src/definitions/models/whisper.ts +44 -0
- package/src/definitions/skills/index.ts +12 -0
- package/src/definitions/skills/talking-character.ts +87 -0
- package/src/definitions/skills/text-to-tiktok.ts +97 -0
- package/src/index.ts +118 -0
- package/src/providers/apify.ts +269 -0
- package/src/providers/base.ts +264 -0
- package/src/providers/elevenlabs.ts +217 -0
- package/src/providers/fal.ts +392 -0
- package/src/providers/ffmpeg.ts +544 -0
- package/src/providers/fireworks.ts +193 -0
- package/src/providers/groq.ts +149 -0
- package/src/providers/higgsfield.ts +145 -0
- package/src/providers/index.ts +143 -0
- package/src/providers/replicate.ts +147 -0
- package/src/providers/storage.ts +206 -0
- package/src/react/cli.ts +52 -0
- package/src/react/elements.ts +146 -0
- package/src/react/examples/branching.tsx +66 -0
- package/src/react/examples/captions-demo.tsx +37 -0
- package/src/react/examples/character-video.tsx +84 -0
- package/src/react/examples/grid.tsx +53 -0
- package/src/react/examples/layouts-demo.tsx +57 -0
- package/src/react/examples/madi.tsx +60 -0
- package/src/react/examples/music-test.tsx +35 -0
- package/src/react/examples/onlyfans-1m/workflow.tsx +88 -0
- package/src/react/examples/orange-portrait.tsx +41 -0
- package/src/react/examples/split-element-demo.tsx +60 -0
- package/src/react/examples/split-layout-demo.tsx +60 -0
- package/src/react/examples/split.tsx +41 -0
- package/src/react/examples/video-grid.tsx +46 -0
- package/src/react/index.ts +43 -0
- package/src/react/layouts/grid.tsx +28 -0
- package/src/react/layouts/index.ts +2 -0
- package/src/react/layouts/split.tsx +20 -0
- package/src/react/react.test.ts +309 -0
- package/src/react/render.ts +21 -0
- package/src/react/renderers/animate.ts +59 -0
- package/src/react/renderers/captions.ts +297 -0
- package/src/react/renderers/clip.ts +248 -0
- package/src/react/renderers/context.ts +17 -0
- package/src/react/renderers/image.ts +109 -0
- package/src/react/renderers/index.ts +22 -0
- package/src/react/renderers/music.ts +60 -0
- package/src/react/renderers/packshot.ts +84 -0
- package/src/react/renderers/progress.ts +173 -0
- package/src/react/renderers/render.ts +243 -0
- package/src/react/renderers/slider.ts +69 -0
- package/src/react/renderers/speech.ts +53 -0
- package/src/react/renderers/split.ts +91 -0
- package/src/react/renderers/subtitle.ts +16 -0
- package/src/react/renderers/swipe.ts +75 -0
- package/src/react/renderers/title.ts +17 -0
- package/src/react/renderers/utils.ts +124 -0
- package/src/react/renderers/video.ts +127 -0
- package/src/react/runtime/jsx-dev-runtime.ts +43 -0
- package/src/react/runtime/jsx-runtime.ts +35 -0
- package/src/react/types.ts +232 -0
- package/src/studio/index.ts +26 -0
- package/src/studio/scanner.ts +102 -0
- package/src/studio/server.ts +554 -0
- package/src/studio/stages.ts +251 -0
- package/src/studio/step-renderer.ts +279 -0
- package/src/studio/types.ts +60 -0
- package/src/studio/ui/cache.html +303 -0
- package/src/studio/ui/index.html +1820 -0
- package/src/tests/all.test.ts +509 -0
- package/src/tests/index.ts +33 -0
- package/src/tests/unit.test.ts +403 -0
- package/tsconfig.cli.json +8 -0
- package/tsconfig.json +21 -3
- package/TEST_RESULTS.md +0 -122
- package/action/captions/SKILL.md +0 -170
- package/action/captions/index.ts +0 -169
- package/action/edit/SKILL.md +0 -235
- package/action/edit/index.ts +0 -437
- package/action/image/SKILL.md +0 -140
- package/action/image/index.ts +0 -105
- package/action/sync/SKILL.md +0 -136
- package/action/sync/index.ts +0 -145
- package/action/transcribe/SKILL.md +0 -179
- package/action/video/SKILL.md +0 -116
- package/action/video/index.ts +0 -125
- package/action/voice/SKILL.md +0 -125
- package/action/voice/index.ts +0 -136
- package/cli/commands/find.ts +0 -58
- package/cli/commands/help.ts +0 -70
- package/cli/commands/list.ts +0 -49
- package/cli/commands/run.ts +0 -237
- package/cli/commands/which.ts +0 -66
- package/cli/discover.ts +0 -66
- package/cli/index.ts +0 -33
- package/cli/runner.ts +0 -65
- package/cli/types.ts +0 -49
- package/cli/ui.ts +0 -185
- package/index.ts +0 -75
- package/lib/README.md +0 -144
- package/lib/ai-sdk/fal.ts +0 -106
- package/lib/ai-sdk/replicate.ts +0 -107
- package/lib/elevenlabs.ts +0 -382
- package/lib/fal.ts +0 -467
- package/lib/ffmpeg.ts +0 -467
- package/lib/fireworks.ts +0 -235
- package/lib/groq.ts +0 -246
- package/lib/higgsfield.ts +0 -176
- package/lib/remotion/SKILL.md +0 -823
- package/lib/remotion/cli.ts +0 -115
- package/lib/remotion/functions.ts +0 -283
- package/lib/remotion/index.ts +0 -19
- package/lib/remotion/templates.ts +0 -73
- package/lib/replicate.ts +0 -304
- package/output.txt +0 -1
- package/test-import.ts +0 -7
- package/test-services.ts +0 -97
- package/utilities/s3.ts +0 -147
package/README.md
CHANGED
|
@@ -1,231 +1,78 @@
|
|
|
1
|
-
# varg
|
|
1
|
+
# varg
|
|
2
2
|
|
|
3
|
-
video generation
|
|
3
|
+
AI video generation from your terminal.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
sdk
|
|
9
|
-
│
|
|
10
|
-
├── media/ # working directory for media files (images, videos, audio)
|
|
11
|
-
├── output/ # generated output files
|
|
12
|
-
│
|
|
13
|
-
├── utilities/
|
|
14
|
-
│
|
|
15
|
-
├── lib/
|
|
16
|
-
│ ├── pymovie/
|
|
17
|
-
│ ├── opencv/
|
|
18
|
-
│ ├── fal/
|
|
19
|
-
│ ├── higgsfield/
|
|
20
|
-
│ ├── ffmpeg/
|
|
21
|
-
│ ├── remotion/
|
|
22
|
-
│ ├── remotion.dev/
|
|
23
|
-
│ └── motion.dev/
|
|
24
|
-
│
|
|
25
|
-
├── service/
|
|
26
|
-
│ ├── image/ # image generation + SKILL.md
|
|
27
|
-
│ ├── video/ # video generation + SKILL.md
|
|
28
|
-
│ ├── voice/ # voice synthesis + SKILL.md
|
|
29
|
-
│ ├── sync/ # lipsync + SKILL.md
|
|
30
|
-
│ ├── captions/ # video captions + SKILL.md
|
|
31
|
-
│ ├── edit/ # video editing + SKILL.md
|
|
32
|
-
│ └── transcribe/ # audio transcription + SKILL.md
|
|
33
|
-
│
|
|
34
|
-
└── pipeline/
|
|
35
|
-
└── cookbooks/
|
|
7
|
+
```bash
|
|
8
|
+
bun install @vargai/sdk
|
|
36
9
|
```
|
|
37
10
|
|
|
38
|
-
## installation
|
|
39
|
-
|
|
40
11
|
```bash
|
|
41
|
-
|
|
12
|
+
varg run image --prompt "cyberpunk cityscape at night"
|
|
13
|
+
varg run video --prompt "camera flies through clouds" --duration 5
|
|
14
|
+
varg run voice --text "Hello world" --voice rachel
|
|
42
15
|
```
|
|
43
16
|
|
|
44
|
-
|
|
17
|
+
## Commands
|
|
18
|
+
|
|
19
|
+
| Command | Description |
|
|
20
|
+
|---------|-------------|
|
|
21
|
+
| `varg run <action>` | Run an action |
|
|
22
|
+
| `varg list` | List all available actions |
|
|
23
|
+
| `varg find <query>` | Search actions by keyword |
|
|
24
|
+
| `varg which <action>` | Show action details and options |
|
|
25
|
+
| `varg help` | Show help |
|
|
26
|
+
|
|
27
|
+
## Actions
|
|
28
|
+
|
|
29
|
+
| Action | Description | Example |
|
|
30
|
+
|--------|-------------|---------|
|
|
31
|
+
| `image` | Generate image from text | `varg run image --prompt "sunset"` |
|
|
32
|
+
| `video` | Generate video from text or image | `varg run video --prompt "ocean waves" --image ./photo.jpg` |
|
|
33
|
+
| `voice` | Text-to-speech | `varg run voice --text "Hello" --voice sam` |
|
|
34
|
+
| `music` | Generate music | `varg run music --prompt "upbeat electronic"` |
|
|
35
|
+
| `transcribe` | Audio to text/subtitles | `varg run transcribe --audio ./speech.mp3` |
|
|
36
|
+
| `captions` | Add subtitles to video | `varg run captions --video ./clip.mp4` |
|
|
37
|
+
| `sync` | Lipsync audio to video | `varg run sync --video ./face.mp4 --audio ./voice.mp3` |
|
|
38
|
+
| `trim` | Trim video | `varg run trim --input ./video.mp4 --start 0 --end 10` |
|
|
39
|
+
| `cut` | Remove section from video | `varg run cut --input ./video.mp4 --start 5 --end 8` |
|
|
40
|
+
| `merge` | Combine videos | `varg run merge --inputs ./a.mp4 ./b.mp4` |
|
|
41
|
+
| `split` | Split video at timestamps | `varg run split --input ./video.mp4 --timestamps 10,20,30` |
|
|
42
|
+
| `fade` | Add fade in/out | `varg run fade --input ./video.mp4 --type both` |
|
|
43
|
+
| `transition` | Add transitions between clips | `varg run transition --inputs ./a.mp4 ./b.mp4` |
|
|
44
|
+
| `upload` | Upload file to S3 | `varg run upload --file ./video.mp4` |
|
|
45
|
+
|
|
46
|
+
Use `varg run <action> --help` for all options.
|
|
47
|
+
|
|
48
|
+
## Environment Variables
|
|
49
|
+
|
|
50
|
+
<details>
|
|
51
|
+
<summary>Required API keys</summary>
|
|
52
|
+
|
|
45
53
|
```bash
|
|
54
|
+
# AI Providers
|
|
46
55
|
FAL_API_KEY=fal_xxx
|
|
47
|
-
HIGGSFIELD_API_KEY=hf_xxx
|
|
48
|
-
HIGGSFIELD_SECRET=secret_xxx
|
|
49
56
|
REPLICATE_API_TOKEN=r8_xxx
|
|
50
|
-
ELEVENLABS_API_KEY=
|
|
57
|
+
ELEVENLABS_API_KEY=xxx
|
|
51
58
|
GROQ_API_KEY=gsk_xxx
|
|
52
59
|
FIREWORKS_API_KEY=fw_xxx
|
|
60
|
+
HIGGSFIELD_API_KEY=hf_xxx
|
|
61
|
+
HIGGSFIELD_SECRET=secret_xxx
|
|
62
|
+
|
|
63
|
+
# Storage (Cloudflare R2)
|
|
53
64
|
CLOUDFLARE_R2_API_URL=https://xxx.r2.cloudflarestorage.com
|
|
54
65
|
CLOUDFLARE_ACCESS_KEY_ID=xxx
|
|
55
66
|
CLOUDFLARE_ACCESS_SECRET=xxx
|
|
56
|
-
CLOUDFLARE_R2_BUCKET=
|
|
67
|
+
CLOUDFLARE_R2_BUCKET=bucket-name
|
|
57
68
|
```
|
|
58
69
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
### as cli
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# generate image with ai-sdk (recommended)
|
|
65
|
-
bun run lib/ai-sdk/fal.ts generate_image "a beautiful sunset" "fal-ai/flux/dev" "16:9"
|
|
66
|
-
|
|
67
|
-
# generate image with fal client (advanced features)
|
|
68
|
-
bun run lib/fal.ts generate_image "a beautiful sunset"
|
|
69
|
-
|
|
70
|
-
# generate video from image (supports local files)
|
|
71
|
-
bun run lib/fal.ts image_to_video "person talking" media/image.jpg 5
|
|
72
|
-
bun run lib/fal.ts image_to_video "person talking" https://example.com/image.jpg 5
|
|
73
|
-
|
|
74
|
-
# generate soul character
|
|
75
|
-
bun run lib/higgsfield.ts generate_soul "professional headshot"
|
|
76
|
-
|
|
77
|
-
# generate video with replicate
|
|
78
|
-
bun run lib/replicate.ts minimax "person walking on beach"
|
|
70
|
+
</details>
|
|
79
71
|
|
|
80
|
-
|
|
81
|
-
bun run lib/elevenlabs.ts tts "hello world" rachel output.mp3
|
|
72
|
+
## Contributing
|
|
82
73
|
|
|
83
|
-
|
|
84
|
-
bun run service/transcribe media/audio.mp3 groq
|
|
85
|
-
bun run service/transcribe media/audio.mp3 fireworks output.srt
|
|
86
|
-
bun run lib/fireworks.ts media/audio.mp3 output.srt
|
|
74
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup.
|
|
87
75
|
|
|
88
|
-
|
|
89
|
-
bun run lib/ffmpeg.ts concat output.mp4 video1.mp4 video2.mp4
|
|
90
|
-
|
|
91
|
-
# lipsync video with audio
|
|
92
|
-
bun run service/sync overlay video.mp4 audio.mp3 synced.mp4
|
|
93
|
-
|
|
94
|
-
# upload file to s3
|
|
95
|
-
bun run utilities/s3.ts upload ./video.mp4 videos/output.mp4
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### as library
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
101
|
-
import { generateImage, imageToVideo } from "varg.ai-sdk"
|
|
102
|
-
import { uploadFromUrl } from "varg.ai-sdk"
|
|
103
|
-
|
|
104
|
-
// generate image
|
|
105
|
-
const img = await generateImage({
|
|
106
|
-
prompt: "a beautiful sunset",
|
|
107
|
-
model: "fal-ai/flux-pro/v1.1",
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
// animate it
|
|
111
|
-
const video = await imageToVideo({
|
|
112
|
-
prompt: "camera pan across scene",
|
|
113
|
-
imageUrl: img.data.images[0].url,
|
|
114
|
-
duration: 5,
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
// upload to s3
|
|
118
|
-
const url = await uploadFromUrl(
|
|
119
|
-
video.data.video.url,
|
|
120
|
-
"videos/sunset.mp4"
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
console.log(`uploaded: ${url}`)
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## modules
|
|
127
|
-
|
|
128
|
-
### lib
|
|
129
|
-
core libraries for video/audio/ai processing:
|
|
130
|
-
- **ai-sdk/fal**: fal.ai using vercel ai sdk (recommended for images)
|
|
131
|
-
- **ai-sdk/replicate**: replicate.com using vercel ai sdk
|
|
132
|
-
- **fal**: fal.ai using direct client (for video & advanced features, supports local file uploads)
|
|
133
|
-
- **higgsfield**: soul character generation
|
|
134
|
-
- **replicate**: replicate.com api (minimax, kling, luma, flux)
|
|
135
|
-
- **elevenlabs**: text-to-speech and voice generation
|
|
136
|
-
- **groq**: ultra-fast whisper transcription (audio to text)
|
|
137
|
-
- **fireworks**: word-level audio transcription with timestamps (srt/vtt)
|
|
138
|
-
- **ffmpeg**: video editing operations (concat, trim, resize, etc.)
|
|
139
|
-
- **remotion**: programmatic video creation with react
|
|
140
|
-
|
|
141
|
-
### media folder
|
|
142
|
-
- **media/**: working directory for storing input media files (images, videos, audio)
|
|
143
|
-
- **output/**: directory for generated/processed output files
|
|
144
|
-
- use `media/` for source files, `output/` for results
|
|
145
|
-
- fal.ts supports local file paths from `media/` folder
|
|
146
|
-
|
|
147
|
-
### service
|
|
148
|
-
high-level services combining multiple libs. each service includes a SKILL.md for claude code agent skills:
|
|
149
|
-
- **image**: image generation (fal + higgsfield)
|
|
150
|
-
- **video**: video generation from image/text
|
|
151
|
-
- **voice**: voice generation with multiple providers (elevenlabs)
|
|
152
|
-
- **transcribe**: audio transcription with groq whisper or fireworks (srt support)
|
|
153
|
-
- **sync**: lipsync workflows (wav2lip, audio overlay)
|
|
154
|
-
- **captions**: auto-generate and overlay subtitles on videos
|
|
155
|
-
- **edit**: video editing workflows (resize, trim, concat, social media prep)
|
|
156
|
-
|
|
157
|
-
### utilities
|
|
158
|
-
- **s3**: cloudflare r2 / s3 storage operations
|
|
159
|
-
|
|
160
|
-
### pipeline
|
|
161
|
-
- **cookbooks**: step-by-step recipes for complex workflows (includes talking-character SKILL.md)
|
|
162
|
-
|
|
163
|
-
## key learnings
|
|
164
|
-
|
|
165
|
-
### remotion batch rendering with variations
|
|
166
|
-
when creating multiple video variations (e.g., 15 videos with different images):
|
|
167
|
-
|
|
168
|
-
**❌ don't do this:**
|
|
169
|
-
```bash
|
|
170
|
-
# overwriting files causes caching issues
|
|
171
|
-
for i in 1..15; do
|
|
172
|
-
cp woman-$i-before.jpg lib/remotion/public/before.jpg # overwrites!
|
|
173
|
-
cp woman-$i-after.jpg lib/remotion/public/after.jpg # overwrites!
|
|
174
|
-
render video
|
|
175
|
-
done
|
|
176
|
-
# result: all videos show the same woman (the last one)
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
**✅ do this instead:**
|
|
180
|
-
```typescript
|
|
181
|
-
// 1. use unique filenames for each variation
|
|
182
|
-
// lib/remotion/public/woman-01-before.jpg, woman-02-before.jpg, etc.
|
|
183
|
-
|
|
184
|
-
// 2. pass variation id as prop
|
|
185
|
-
interface Props { variationId?: string }
|
|
186
|
-
const MyComp: React.FC<Props> = ({ variationId = "01" }) => {
|
|
187
|
-
const beforeImg = staticFile(`woman-${variationId}-before.jpg`);
|
|
188
|
-
const afterImg = staticFile(`woman-${variationId}-after.jpg`);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// 3. register multiple compositions with unique props
|
|
192
|
-
registerRoot(() => (
|
|
193
|
-
<>
|
|
194
|
-
{Array.from({ length: 15 }, (_, i) => {
|
|
195
|
-
const variationId = String(i + 1).padStart(2, "0");
|
|
196
|
-
return (
|
|
197
|
-
<Composition
|
|
198
|
-
id={`MyVideo-${variationId}`}
|
|
199
|
-
component={MyComp}
|
|
200
|
-
defaultProps={{ variationId }}
|
|
201
|
-
{...otherProps}
|
|
202
|
-
/>
|
|
203
|
-
);
|
|
204
|
-
})}
|
|
205
|
-
</>
|
|
206
|
-
));
|
|
207
|
-
|
|
208
|
-
// 4. render each composition
|
|
209
|
-
bun run lib/remotion/index.ts render root.tsx MyVideo-01 output-01.mp4
|
|
210
|
-
bun run lib/remotion/index.ts render root.tsx MyVideo-02 output-02.mp4
|
|
211
|
-
```
|
|
76
|
+
## License
|
|
212
77
|
|
|
213
|
-
|
|
214
|
-
- remotion's `staticFile()` caches based on filename
|
|
215
|
-
- overwriting files between renders causes all videos to use the last cached version
|
|
216
|
-
- unique filenames + props ensure each render uses correct assets
|
|
217
|
-
|
|
218
|
-
### fal.ai nsfw content filtering
|
|
219
|
-
fal.ai automatically filters content that may be nsfw:
|
|
220
|
-
|
|
221
|
-
**symptoms:**
|
|
222
|
-
- image generation succeeds but returns empty file (~7.6KB)
|
|
223
|
-
- no error message
|
|
224
|
-
- happens with certain clothing/body descriptions
|
|
225
|
-
|
|
226
|
-
**solution:**
|
|
227
|
-
- be explicit about modest, full-coverage clothing:
|
|
228
|
-
- ✅ "long sleeve athletic top and full length leggings"
|
|
229
|
-
- ❌ "athletic wear" (vague, may trigger filter)
|
|
230
|
-
- add "professional", "modest", "appropriate" to prompts
|
|
231
|
-
- always check file sizes after batch generation (< 10KB = filtered)
|
|
78
|
+
Apache-2.0 — see [LICENSE.md](LICENSE.md)
|
package/SKILLS.md
CHANGED
|
@@ -42,9 +42,16 @@ located in `service/<name>/SKILL.md`:
|
|
|
42
42
|
- transcribe audio to text or subtitles using groq/fireworks
|
|
43
43
|
- cli: `bun run service/transcribe <audioUrl> <provider> [outputPath]`
|
|
44
44
|
|
|
45
|
+
### library skills
|
|
46
|
+
|
|
47
|
+
8. **apify-scraping** (`lib/apify.ts`)
|
|
48
|
+
- run apify actors for web scraping (tiktok, google maps, social media, etc.)
|
|
49
|
+
- cli: `bun run lib/apify.ts run <actor_id> [input_json]`
|
|
50
|
+
- example: `bun run lib/apify.ts run clockworks/tiktok-scraper '{"hashtags":["viral"],"resultsPerPage":10}'`
|
|
51
|
+
|
|
45
52
|
### utility skills
|
|
46
53
|
|
|
47
|
-
|
|
54
|
+
9. **telegram-send** (external: `/Users/aleks/Github/Badaboom1995/rumble-b2c`)
|
|
48
55
|
- send videos to telegram users/channels as round videos
|
|
49
56
|
- automatically converts to 512x512 square format for telegram
|
|
50
57
|
- cli: `cd /Users/aleks/Github/Badaboom1995/rumble-b2c && bun run scripts/telegram-send-video.ts <videoPath> <@username>`
|
|
@@ -54,16 +61,22 @@ located in `service/<name>/SKILL.md`:
|
|
|
54
61
|
|
|
55
62
|
located in `pipeline/cookbooks/SKILL.md`:
|
|
56
63
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
10. **talking-character-pipeline** (`pipeline/cookbooks/`)
|
|
65
|
+
- complete workflow to create talking character videos
|
|
66
|
+
- combines: character generation → voiceover → animation → lipsync → captions → social prep
|
|
67
|
+
|
|
68
|
+
11. **round-video-character** (`pipeline/cookbooks/round-video-character.md`)
|
|
69
|
+
- create realistic round selfie videos for telegram using nano banana pro + wan 2.5
|
|
70
|
+
- workflow: generate selfie first frame (person in setting) → voiceover → wan 2.5 video
|
|
71
|
+
- uses: `bun run lib/fal.ts`, `bun run lib/replicate.ts`, `bun run lib/elevenlabs.ts`
|
|
72
|
+
- input: text script + profile photo
|
|
73
|
+
- output: extreme close-up selfie video with authentic camera shake, lighting, and audio
|
|
60
74
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- output: extreme close-up selfie video with authentic camera shake, lighting, and audio
|
|
75
|
+
12. **trendwatching** (`pipeline/cookbooks/trendwatching.md`)
|
|
76
|
+
- discover viral tiktok content for any topic/hashtag
|
|
77
|
+
- uses apify tiktok scraper to find trending videos
|
|
78
|
+
- get engagement metrics: plays, likes, shares, comments
|
|
79
|
+
- cli: `bun run lib/apify.ts run clockworks/tiktok-scraper '{"hashtags":["topic"],"resultsPerPage":10}'`
|
|
67
80
|
|
|
68
81
|
## structure
|
|
69
82
|
|
|
@@ -145,9 +158,11 @@ each skill includes:
|
|
|
145
158
|
| video-captions | captions | add subtitles, accessibility |
|
|
146
159
|
| video-editing | edit | resize, trim, social media optimization |
|
|
147
160
|
| audio-transcription | transcribe | speech-to-text, subtitle generation |
|
|
161
|
+
| apify-scraping | lib/apify | web scraping via apify actors (tiktok, etc.) |
|
|
148
162
|
| telegram-send | external | send videos to telegram as round videos |
|
|
149
163
|
| talking-character-pipeline | pipeline | end-to-end talking character videos |
|
|
150
164
|
| round-video-character | pipeline | telegram round selfie videos with wan 2.5 |
|
|
165
|
+
| trendwatching | pipeline | discover viral tiktok content by hashtag |
|
|
151
166
|
|
|
152
167
|
## see also
|
|
153
168
|
|
|
@@ -155,3 +170,4 @@ each skill includes:
|
|
|
155
170
|
- [STRUCTURE.md](STRUCTURE.md) - detailed module organization
|
|
156
171
|
- [pipeline/cookbooks/talking-character.md](pipeline/cookbooks/talking-character.md) - talking character workflow
|
|
157
172
|
- [pipeline/cookbooks/round-video-character.md](pipeline/cookbooks/round-video-character.md) - telegram round selfie video cookbook
|
|
173
|
+
- [pipeline/cookbooks/trendwatching.md](pipeline/cookbooks/trendwatching.md) - discover viral tiktok content
|
package/biome.json
CHANGED