ZyVOP Logo
Content That Connects
SeriesAI NewsLeaderboardWrite for Us
ZyVOP Logo
Content That Connects

Empowering developers and creators with cutting-edge insights, comprehensive tutorials, and innovative solutions for the digital future.

Content

  • Categories
  • Tags
  • Badges
  • Leaderboard
  • Write Article
  • Newsletter

Company

  • About Us
  • API Documentation
  • Write for Us
  • Contact

Connect

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DMCA Policy
  • Code of Conduct

© 2026 ZyVOP. Crafted with care for the developer community.

Made with ❤️ by the ZyVOP team
All systems operational
HomeCase StudiesHow I Cut AI Video Generation Costs by 8x
Case Studies

How I Cut AI Video Generation Costs by 8x

Igor Shadurin
Igor ShadurinSenior Developer
August 7, 2026
3 min read
#AI Video#Cost Optimization#open-source#Image Generation

featured image - How I Cut AI Video Generation Costs by 8x

A few months ago, I was working on a pet project. YumCut is an end-to-end service for creating short vertical videos, from writing the text and generating images to editing and adding subtitles.


A critical problem surfaced quickly: cost. One minute of video required around twenty generated images, or about $0.80 per minute. Beyond visuals, audio generation added another $0.20 per minute, along with minor additional costs for editing and subtitle generation.


I started looking for a way out. This article explores the unconventional techniques that helped reduce those costs several times over, as well as an open-source solution that makes it possible to generate images up to eight times cheaper than commercial APIs.

Full code and instructions are available on GitHub.

First approach: multiple scenes in one frame

The logical solution seemed obvious: generate several images in a single request by placing scenes next to each other. In theory, this should reduce costs proportionally to the number of images.


The first attempt was to put all eight scenes into the prompt at once. The result was disastrous: the model simply mixed all elements into one blurry composition, unusable for video editing.


Igor Shadurin's image-884a08

By reducing the number of scenes to two per image, I got an acceptable result. That already cut the cost in half, but it was still far from the target.

Key insight: borders must be literally visible

It turned out that AI models struggle to determine logical boundaries between separate areas. The solution was simple: use colored zones (red and blue).

Igor Shadurin's image-ce449

Instead of an abstract description, I started sending a PNG template with clear borders and a matching instruction: “The first idea is in the red area, the second idea is in the blue area. Fill each area completely.”


Igor Shadurin's image-27209

This technique did not require additional costs, but it dramatically improved the quality of scene separation. The model now understood the structure and rarely mixed elements.


However, this was only a partial solution. I needed a drastic reduction. I had to cut the price by another order of magnitude.

Second approach: migrating to open-source alternatives

The idea was to find open-source/open-weight image-generation models, run them in the cloud, and reduce costs that way.

First, I had to identify which models were freely available. There are many: Qwen-Image, FLUX, HunyuanImage, Stable Diffusion, and others. For my use case, I had one extra requirement - the ability to reuse characters across many generated images. That is why I chose Qwen-Image-Edit.


I audited the market of commercial generators:

  • Major APIs (OpenAI/Google Gemini/Stability AI): similar prices or higher

  • Alibaba cloud services: about $0.04 per image - roughly the same

  • Self-hosted options like RunPod: you need a large number of images per run to reach meaningful savings


The picture was disappointing - even the creators of Qwen-Image, Alibaba, were offering the model at inflated prices. But then I found runware.ai and together.ai, where generating images with Qwen-Image-Edit and Qwen-Image was almost eight times cheaper than Nano Banana - ~$0.005 vs. $0.04.

Third approach: improving image detail

As it turned out, with low image-generation prices, the model started producing more uniform images - all scenes looked too similar to each other.


Here is an example of generated images with different prompts about a happy cat on the beach:


Igor Shadurin's image-bbf908Igor Shadurin's image-0684dIgor Shadurin's image-1d2688

Even though the images look good, there is a missing layer for improving the story prompts. The obvious solution is to add a layer between the story prompt and the image generator. But we have to do so with an LLM that doesn't increase the cost significantly. So I knew I needed to test many LLMs before settling on one that worked best for me.


To do so, I used openrouter.ai. Once you write the wrapper code, you can switch to any available model. After testing a dozen models, I settled on openai/gpt-oss-120b with low reasoning effort. The improved image-generation prompt costs about ~$0.0003, and the images above turn into results like these.


Igor Shadurin's image-3cc81Igor Shadurin's image-2cc1e8Igor Shadurin's image-c7bbf

The images became more diverse, even with an almost identical prompt. GPT OSS improved the description for Qwen-Image, and it also offered a lever that let me control the style and mood of the images.

Results: numbers that speak for themselves



Metric

Before

After

Savings

Cost per image

$0.04

$0.0053

7.54

1-minute video (20 images)

$0.8

$0.106

7.54

Full minute of video

$1

$0.306

3.26

By combining the two approaches, the price drops by another factor of two, but sometimes you will see artifacts in the images because the original image is being split.


This price was good enough for me, so I stopped at this result.


Igor Shadurin

Igor Shadurin

Passionate developer sharing knowledge about modern web technologies and best practices.

Comments (0)

Login to post a comment.

Related Posts

I built ClipSave, an open-source Android media downloader with batch downloads, playlists, and 1000+ supported sites

I’ve been building ClipSave, a free and open-source media downloader for Android. It can download video, audio, and images from more than 1,000 websites, includ...

Read article

AirLLM: Running Giant AI Models on Everyday Hardware

AirLLM lets you run 70B+ parameter models on a consumer GPU with as little as 4GB of VRAM — no quantization, no accuracy loss, no data center. A layer-by-layer streaming trick makes it possible. Here's how it works and who should use it.

Read article

Building a Native GTK4 PostgreSQL Client Because I Was Tired of Electron

Why I built a native GTK4 PostgreSQL client instead of another Electron app — schema designer, AI analytics, and a Python/Perl hook system included.

Read article

Why Cosine Similarity Fails to Catch Confusable MCP Tools

Cosine similarity fails to catch confusable MCP tools. Here's the schema-substitutability approach that actually worked, packaged as an open-source lint tool called mcplock.

Read article

Why I Validate Angular Compatibility Using the Published npm Package (Not the Source Code)

Most Angular libraries claim compatibility across multiple Angular versions—but how many actually verify it? Here's why I stopped testing my source code and started validating the packaged npm artifact that users really install.

Read article