Four Ways My Unattended Video Pipeline Died Overnight — and How I Made It Heal Itself

2026年8月16日1 次浏览来源:Dev.to阅读原文

The morning after I lost my job, my Mac finished and filed an ASMR video.

Nobody asked it to.

It just ran.

In the first post, I walked through the structure of the pipeline itself — ComfyUI × FFmpeg × the Freesound API, generating long-form ASMR videos with nothing but free tools.

This second post covers the other half: putting that pipeline on macOS launchd so it fires at a fixed time every day, and the self-healing logic that gets the script past the "cold start" problem, where you boot the Mac and ComfyUI simply isn't running.

Two numbers do most of the work here: the ComfyUI startup wait went from 180 seconds to 600, and the Freesound download timeout went from 90 seconds to

240.

Before those changes, mornings failed 2–3 days a week.

Why this setup works The ceiling on manual work Making a single 30-minute ambient ASMR video carefully takes 2–3 hours of hands-on time.

Tuning image-generation prompts, layering the BGM, checking the loop points, building the thumbnail, filling in YouTube metadata — each step is small, but they stack up.

Trying to hold 30 videos a month means 60–90 hours of pure labor.

I attempted it while holding a side job, and it collapsed in two weeks.

That was the first time I understood that "scaling output" isn't about moving your hands faster — it's about building a state where output accumulates without your hands at all.

When I was laid off and my income went to zero, the first thing I rebuilt was this environment.

Own an environment, not a workflow The essence of automation is constructing, exactly once, a mechanism where output keeps growing while you do nothing.

That's precisely what delivers: when the script finishes, lands atomically with the video, thumbnail, youtube.md, and still image all in place.

I just check it the next morning.

Whether I step away mid-generation or I'm asleep, the files keep piling up.

One line in the code embodies the whole philosophy: Even if launchd tries to fire in both the 07:00 and 14:00 slots, the script returns immediately with when today's directory already exists under .

No double generation.

If the Mac sleeps partway through, the 14:00 slot handles recovery.

That's the core of the idempotent-slot design.

Why it costs ¥0/month This pipeline is deliberately designed to cost nothing monthly.

Image generation: ComfyUI ( / RealVisXL / MPS) = free Motion synthesis: FFmpeg (displace / perlin flicker) = free Ambient sound: Freesound API, CC0-licensed = free ( is issued on free signup) Upload target: YouTube Data API v3 = the free quota is plenty The only things I actually need are electricity for the Mac itself and a Google Cloud OAuth client (free registration, just issuing an API key).

No paid SaaS image generation, no cloud GPU, no monthly subscription.

This design eliminates the risk of "an external service changes its pricing and my machinery breaks." Since ComfyUI and FFmpeg both run locally, a sudden price hike or the death of a free tier can't stop the automation.

Even right after my income dropped to zero, this one thing kept running. coverage.csv kills the anxiety To sustain monthly revenue, you have to break the loop where you get anxious about whether the machinery is still working and go check on it.

Appending to is the design that does that: One glance at a single line of this CSV each morning tells me whether yesterday's 07:00 slot succeeded.

When the YouTube upload succeeds, the trailing status field changes to (overwritten via ).

Less anxiety means fewer unnecessary edits to the machinery, which means longer stretches of stable operation.

The other benefit of idempotency Idempotent design also gives you backfill as a byproduct.

Point the option at a past date and the same script fills in the gap after the fact: skips launching ComfyUI and reuses an existing still image.

Because ComfyUI's MPS inference takes several minutes, I've actually used this a few times when I liked the image but wanted different BGM.

Without that flag, runs as usual — and that

分享
Baike.dev

baike.dev helps you discover great languages, frameworks, databases, DevOps and cloud-native tools.

Quick links

About

Contribute

Found a great developer tool? Share it with the community.

Submit a tool
© 2026 baike.dev Developer EncyclopediaUpdated daily · Discover great developer tools