There are two ways to use this project:
-
nvm install -
nvm use -
npm install -
Ensure Redis is available locally (for example on macOS:
brew services start redis) -
Create
.env. -
Build:
npm run build -
Start the worker and admin UI:
npm start -
In another terminal, run jobs using JSON files:
node dist/prompt.js prompt/deforum-fish.json(createsprompt/deforum-fish.mp4)node dist/prompt.js prompt/animatediff-dog.json(createsprompt/animatediff-dog.mp4)node dist/prompt.js prompt/uprez-example.json(createsprompt/uprez-example.mp4)- By default, output files are saved alongside the input JSON with a
.mp4extension - Use
-oto specify a custom output path:node dist/prompt.js prompt/deforum-fish.json -o my-custom-name.mp4
Notes:
- The worker now always returns a presigned URL, and the CLI downloads to your machine.
Required env vars (local development)
- RUNPOD_API_KEY
- RUNPOD_ANIMATEDIFF_ENDPOINT_ID
- RUNPOD_HUNYUAN_ENDPOINT_ID
- RUNPOD_DEFORUM_ENDPOINT_ID
- RUNPOD_UPREZ_ENDPOINT_ID
- ADMIN_PASS (password for username
adminin the admin UI) - Redis: use local redis info (
REDIS_HOST=localhost,REDIS_PORT=6379,REDIS_PASSWORD='').
- Build once:
npm run build - Point the CLI at the same Redis used by the worker. The CLI process needs a few env vars due to validation:
- Required:
REDISCLOUD_URL
- Required:
node dist/prompt.js prompt/animatediff-dog.json -o ./out/dog.mp4
node dist/prompt.js prompt/uprez-example.json -o ./out/uprez.mp4
node dist/prompt.js prompt/deforum-fish.json -o ./out/deforum.mp4How it works
- The worker returns
{ r2_url: <presigned-url> }. - The local CLI downloads from the provided URL to your specified
-opath (or the default path when-ois omitted).
- Visit https://www.runpod.io/console/serverless/user/endpoint/89vs9h0qx0g966?tab=requests to see recent activity and cancel jobs you don't wish to keep running.
- https://apps.apple.com/us/app/red-2-ui-for-redis/id1491764008?mt=12 is helpful for seeing what's in Redis
- https://gpu-worker-0ac312b41451.herokuapp.com/admin/queues/ for the stage and https://gpu-worker-prod-8775591876d9.herokuapp.com/admin/queues for alpha Bull Dashboard (login the user "admin" and the password from the .env)
Marketing sends are triggered from the worker/ project and processed by the marketing worker.
worker/.envmust include:BACKEND_URL(backend API base URL, e.g.https://api-stage.infinidream.ai/api/v1)BACKEND_API_KEY(admin API key)MARKETING_EMAIL_SECRET(shared internal secret)MARKETING_CONCURRENCY(optional, default 50)
- Resend template must include variable
UNSUBSCRIBE_URLin the template body- Example:
<a href="{{UNSUBSCRIBE_URL}}">Unsubscribe</a>
- Example:
cd worker
pnpm run buildpnpm run marketing:send -- --template-id tpl_123 --dry-runpnpm run marketing:send -- --template-id tpl_123 --limit 100 --offset 0Send to one specific user:
pnpm run marketing:send -- --template-id tpl_123 --email user@example.comor by user id:
pnpm run marketing:send -- --template-id tpl_123 --user-id 42The command starts the marketing worker in-process and will auto-exit when the queue is empty. You can also stop it early with Ctrl+C.