LAB

Internal tooling
and AI production

We build tools for ourselves before we offer them to clients. Here: utilities, video pipelines and methodologies proven on our own workload.

AI Production

2026

Visual persona for an AI assistant

A visual identity for an AI assistant in a dark-red noir style: a portrait with neon rain and red rim lighting. The master frame is generated with kie GPT-4o Image at a 2:3 aspect ratio, with a backup variant. Animation is done not with AI video but with lightweight ffmpeg loops built from the static portrait: zoompan breathing and sway, an eq pulse. The output is encoded as WEBM VP9 at 512×512, up to 3 seconds, under 256 KB, no audio — matching Telegram's video-sticker requirements. Four emotion frames were produced: calm, glow, sway, defiance. From these, an animated sticker pack was assembled via the Telegram Bot API. The persona can be wired to a bridge bot to send the face animation on a trigger.

Portrait via kie GPT-4o Image, 2:3 aspect ratioStickers: WEBM VP9 512×512, ≤3 s, ≤256 KB4 emotion frames
2026

Music-to-video production pipeline

A repeatable process for assembling a music video from existing artwork and a track. Source frames are cropped out of collages with an inner margin and, where needed, cleaned up and upscaled via kie GPT-image in image-to-image mode. Animation uses Kling 2.6 image-to-video as the default engine: one generation yields about 5 seconds at roughly 1652×1252; Veo is the alternative. To make the edit "hear" the track, the audio is split into stems with Demucs, vocals are run through Whisper for line timecodes, and beats and tempo are computed with spectral flux and autocorrelation. Editing is done in ffmpeg: crop-fill to 1920×1080, Ken Burns via zoompan, hard cuts on beat multiples and vocal entries, color grading, vignette and grain. Proven on a real music-video project.

Kling 2.6 i2v: ~5 s per generation, ~1652×1252Audio map: Demucs (stems) + Whisper (timecodes)Beats via spectral flux and tempo autocorrelation
2026

Promo reel for a trade-show screen

A looped cinematic reel for a TV screen at a trade show, made for an agricultural holding (a national supplier of seeds and crop protection products). Runtime 5:00, 1920×1080, H.264, edited without sound for silent playback at the booth. Live product footage (website, CRM, customer portal) is captured via headless Chrome and page.screencast, then normalized to a constant fps. Six agricultural shots are generated with kie GPT-image and animated in Kling 2.6 image-to-video — short clips of about 5 seconds each. The intro, the outro with a QR code and the lower-third plates are rendered as transparent PNGs from HTML. Final assembly in ffmpeg: crop-fill, alpha-fade overlays, an xfade chain and looping to full duration. Generation cost — about 410 credits per reel.

Runtime 5:00, 1920×1080, H.2646 agricultural shots animated in Kling 2.6 i2v, clips ~5 sProduct capture via headless Chrome (page.screencast)
2026

Video tutorial for platform registration

A "how to register on the platform" tutorial screencast for an agricultural holding (a national supplier of seeds and crop protection products). The final cut is 1920×1080, H.264, about 94 seconds, ~13 MB, plus a poster frame. The format: a real registration walkthrough in headless Chrome with animated step plates, a synthetic cursor and field highlighting. Six steps from role selection to a finished account, plus an intro and outro. The Russian voiceover is synthesized with edge-tts using the Svetlana voice, slowed down, with each segment's duration computed from the actual length of the line. Capture runs per segment; webm is normalized to mp4 at a fixed fps. Plates and full-screen frames are built as transparent PNGs from HTML. Assembly in ffmpeg: duration fitting, alpha-fade overlays, voiceover mix, and a final re-encode for smooth scrubbing. The same pipeline produced two "how to post a lot" videos — for the seller (~69 s) and the buyer (~65 s).

Final cut 1920×1080, H.264, ~94 s, ~13 MB6 registration steps plus intro and outroVoiceover via edge-tts, Svetlana voice

Lab

2026

API balance monitoring in the macOS menu bar

A native macOS menu-bar utility built with Python and rumps: it shows remaining balances for every working API key from a single env file (chmod 600, kept outside the repository). Balances are polled in parallel via ThreadPoolExecutor — a full cycle takes about 1.5 seconds; auto-refresh runs every 10 minutes in a background thread with rendering on the main one. Spend deltas are displayed next to each balance, history is logged to jsonl, and a native macOS notification fires when a balance hits zero. OpenRouter, KIE and HeyGen expose live balances over their APIs; providers without a public endpoint are shown as a link to their billing page. A separate dashboard page assembles white cards with SVG trend sparklines. Adding a new provider takes one polling function and one list entry. Autostart is packaged as a LaunchAgent.

Parallel polling via ThreadPoolExecutor — full cycle ~1.5 sAuto-refresh every 10 minutes in a background threadLive API balances: OpenRouter, KIE, HeyGen
2026

Background-generation connector for kie GPT-4o Image

A connector for image generation via the kie.ai GPT-4o Image API — a reference Python script with a Bearer token kept in a separate env file. The request: POST to generate with a prompt and size (3:2, 2:3 or 1:1) returns a taskId; the script then polls record-info until status SUCCESS, and the finished image is available in resultUrls. The key methodological principle: the model is unreliable with Cyrillic text, HEX codes and exact dimensions, so kie is used only for photorealistic, text-free backgrounds. All text, logos and QR codes are composited on top with HTML/CSS layout at exact millimeter dimensions — this is how print-ready banners and posters are assembled. Separating the layers — generative background on one side, vector typography on the other — makes the result predictable and production-grade.

POST generate → taskId, polling record-info until SUCCESSFrame formats: 3:2, 2:3, 1:1kie is used only for text-free photo backgrounds (the model is unreliable with Cyrillic and HEX)
2026

Raster to large-format print with sharp text

A repeatable pipeline for preparing a low-resolution raster for large-format print with sharp text; proven on an infographic for a composite-rebar manufacturer (source 1280×853, print format 1500×1000 mm). The key principle: AI upscaling sharpens the graphics, but small text still looks "generated" with wavy edges, so the actual print text is re-set as true vector type on top of the upscale. Steps: Real-ESRGAN (x4plus-anime model, two passes) and a Lanczos downscale to 150 dpi — enough for a 1.5-meter banner; the layout grid is measured with a numpy dark-pixel detector, not by eye; the old text is masked with flat background fills and re-set in Roboto Condensed Bold, instanced from the variable font via fontTools. reportlab draws the vector PDF, and ghostscript converts the fonts to outlines without losing the background.

Source 1280×853 → print at 1500×1000 mmReal-ESRGAN x4plus-anime, two passes, Lanczos downscale to 150 dpiLayout grid measured with a numpy pixel detector, not by eye
2026

Criteria-based scoring of commercial properties

A methodology for sourcing and evaluating commercial properties against a specific use case. Every listing is consolidated into a single HTML table with floor area, price, address, RUB/m² rate and a checklist verdict. Criteria are fixed upfront and strict: ceiling height from 4–5 meters with 6+ as the ideal, a large column-free hall, ground floor or a standalone building, no residential housing nearby, headroom in power and ventilation capacity. Listings are ranked along these axes, not by how the photos feel. The data source — CIAN (national property listings platform) — is protected by a CAPTCHA and blocks automated access, so listing cards are captured manually from screenshots. The output is three scenario baskets for the task: a premium city-center option, the best hall geometry, and a fast low-budget start.

Strict checklist: ceilings from 4–5 m, ideal 6+, column-free hall, ground floorA single RUB/m² rate to compare listingsSource is CAPTCHA-protected — captured from screenshots, ranked by criteria