Community编程与开发github.com

kein_api_loop_pack

This section replaces the old prompt pattern (subject performs a slow cyclic action and returns to its starting pose). That pattern is retired: it made the subject a performer and invited lip movement on audio-native models. Every new pack prompt follows the template below, from the ambient-loop doctrine (v1.1 cinemagraph framing, v1.2 genre slots). The doctrine's source document, `DOKTRIN_LOOP_AMBIEN.md`, is an external document (author's internal archive, not in this repo); §1 of this skill is its working summary, and a standalone summary is being prepared at `docs/video-editing/doktrin-loop-ambien.md`.

kein_api_loop_pack 是什么?

kein_api_loop_pack is a Claude Code agent skill that this section replaces the old prompt pattern (subject performs a slow cyclic action and returns to its starting pose). That pattern is retired: it made the subject a performer and invited lip movement on audio-native models. Every new pack prompt follows the template below, from the ambient-loop doctrine (v1.1 cinemagraph framing, v1.2 genre slots). The doctrine's source document, `DOKTRIN_LOOP_AMBIEN.md`, is an external document (author's internal archive, not in this repo); §1 of this skill is its working summary, and a standalone summary is being prepared at `docs/video-editing/doktrin-loop-ambien.md`.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/masjavas7/skill-muse-masjavas/tree/HEAD/skills/kein_api_loop_pack

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

KEIN API Loop Pack Production

Tujuan: Produce a seamless video loop pack through the KEIN API in idempotent text-only batches — reference-mode proof, per-batch frame QA, disk-verified finals. Cakupan: KEIN OMNI 1.1 text-only loop packs (50 clips). Prompt doctrine: ambient-loop doctrine v1.1/v1.2, summarised in §1 of this skill. Prasyarat / baca dulu: KEIN custom connector (local to the author's workspace, not in this repo — see "Available connectors"); character identity text locked before batching. Status: BERLAKU — per 16 Nov 2026 (revised in the repo restructure: doctrine source marked external, L3; approval-card lifetime annotated unverified, D42). Dokumen terkait: skills/flow_video_loop_pack/SKILL.md (fallback route); docs/video-editing/doktrin-loop-ambien.md (summary in preparation); docs/GLOSARIUM.md (SSIM, md5, idempotency key, HTTP 422 vs guard 422, SEQ_DONE, frame zero, twin).

Build prompts with the ambient-loop doctrine (v1.1/v1.2)

This section replaces the old prompt pattern (subject performs a slow cyclic action and returns to its starting pose). That pattern is retired: it made the subject a performer and invited lip movement on audio-native models. Every new pack prompt follows the template below, from the ambient-loop doctrine (v1.1 cinemagraph framing, v1.2 genre slots). The doctrine's source document, DOKTRIN_LOOP_AMBIEN.md, is an external document (author's internal archive, not in this repo); §1 of this skill is its working summary, and a standalone summary is being prepared at docs/video-editing/doktrin-loop-ambien.md.

Fixed prompt order, never reordered:

  1. Identity lock, verbatim, as in previous packs (character text only, never an image field).
  2. Scene: subject as listener or witness, never performer. One silent, unrhythmic activity only (sitting quietly, holding a warm cup with both hands, writing slowly in a journal, gazing into the distance, listening). Prefer rear-view, over-shoulder, profile, or silhouette framing where the scene allows it. Face occupies at most about 25% of frame height, or is not the sharpest plane in the frame.
  3. One motion sentence naming at most 1-2 ambient elements, all oscillation (swaying leaves, drifting hair, curtain, candle flame, light shimmer, water ripple, grass). Directional motion (falling rain, rising steam, breaking waves, flowing river, walking) appears only blurred, distant, or in the background, or not at all.
  4. Freeze sentence, verbatim: "Everything else in the frame is completely frozen, like a still photograph."
  5. Mouth rule, verbatim: "Her lips are gently closed and completely still, no lip movement, no mouth opening. She does not move to any rhythm; her breathing is slow and calm." (Adapt pronouns to the character.)
  6. Audio line: "Audio: only [ambient soundscape], no music, no vocals, no dialogue." The generated audio is discarded at compilation, so this line costs nothing and removes anything the model could lip-sync to.
  7. Loop suffix: "The motion is a slow continuous ambient cycle that returns exactly to its starting frame, seamless loop, static locked-off camera."
  8. Negative block, verbatim, at the end of every prompt: "Negative: no singing, no lip movement, no mouth opening, no talking, no dancing, no performing, no microphone, no rhythmic head bobbing, no beat-synced motion, no camera movement, no cuts, no text, no watermark."

Hard writing rules for every prompt:

  • No quotation marks anywhere in the prompt; the model reads quoted text as speech to lip-sync.

  • No words for music, song, performer, or stage except inside the negative block. The genre word itself does not need to appear in the prompt.

  • Genre lives only in five slots: setting, time and light, silent activity, ambient motion, soundscape. Everything else in the prompt never changes between genres. Fast-tempo genres get brighter light, more saturated colour, and slightly larger ambient amplitude on environmental elements, never faster body motion or beat-synced motion.

  • Per-genre bans (in addition to the negative block): reggae, no smoke of any kind, no stage, no dancing; nostalgia, no modern gadgets, no neon, no conspicuously modern furniture; galau, no theatrical tears or acting, sadness carried by rain and dim light; slow rock Malaysia, no stage and no microphone; pop ballad, piano as furniture only, never played; dangdut koplo, no stage, no singer, no dancing, energy from lamps and colour; afro house, no dancing and no rhythmic motion of any kind; islami, no acted worship scene, only calm dawn atmosphere.

Pilot gate before a new genre or a new pack formula:

  • One pilot clip per new genre; a new formula needs three pilots (rain window listener, beach dusk hangout, rainy night window with candle).

  • A pilot passes only if: the mouth zoom strip (2x zoom on the mouth at 0/25/50/75/100%) shows closed lips in every frame, no rhythmic body motion appears, and the ping-pong master passes SSIM 1.0 (frame-similarity metric; 1.0 = identical) plus matching md5 hashes (see docs/GLOSARIUM.md).

  • Do not start a 50-clip pack on an unpiloted genre or formula.

Prove the text-only reference mode first

  • Use text-only prompts as the default for this API and never send a reference photo in the image field for a loop pack.

  • Write the character identity from the reference photo into detailed text and paste that identity text verbatim into every concept so the character stays consistent without an image input.

  • Treat reference-only wording as unproven on its own because wording did not stop the image field from behaving as first-frame mode in the evidence window.

  • Check frame zero (the first frame of the clip — see docs/GLOSARIUM.md) of a probe clip before batching and reject the probe if frame zero shows the reference photo or a crop of it before morphing into the scene.

Run idempotent batches from a durable script

  • Store the batch script in the project folder and never in a temporary folder that a restart can discard.

  • Work in batches of 10 and check each batch completely before starting the next batch.

  • Send the idempotency key as an HTTP header and never inside the JSON body so the server does not reject the request with a 422 error and no task. (An idempotency key is a unique per-task key sent as an HTTP header so a retry does not create or charge a duplicate task. HTTP 422 here means "Unprocessable Entity" — do not confuse it with guard 422, the lock that holds live Stage 2 distribution; see docs/GLOSARIUM.md.)

  • Resolve a relative output path against the API base before downloading and never treat a relative path as an absolute URL.

  • Download every output to a temporary file first and retry on truncation or size mismatch.

  • Verify Content-Length and frame count on the temporary file before atomically renaming it to its final name and never write a download directly to its final path.

  • Isolate a failed download to its own concept and never let one failed download fail the whole wave.

  • Log the task id, the idempotency key, the status and the file paths for every concept so a rerun can reuse a completed task instead of charging twice.

  • After an interruption, inspect the disk first and rerun only missing or truncated masters, reusing the same key for the affected concept.

  • Start a new key with the identical scene and version it as v2 when a same-key retry returns the same locked failed task, and never keep retrying the locked key.

  • Retrieve any needed key only from the service dashboard for the current session, use it transiently, and never save it to a file or a note or display its value.

  • Count a watcher or probe run as a success only when the master file exists on disk and its SSIM pass line is present. (A watcher is a monitoring process that checks task or quota status periodically.) Never count SEQ_DONE, a task completed status, or a runner completion line as a success on its own, because the runner prints SEQ_DONE on task failure as well — SEQ_DONE is a runner log line, not proof of success (see docs/GLOSARIUM.md).

  • When a previously passing control prompt also fails, treat the failure as a provider outage rather than a pack defect. Probe every 20 minutes with a fresh key and stop after 12 cycles instead of burning quota on full waves.

  • Redo only the listed concept numbers. Never redo a range that includes clean clips, because a range redo can overwrite clean finals.

Check every batch at frame zero and later frames

  • Check frame zero of every clip for a direct start in the scene with the correct character, and check a later frame for a second person who was absent at frame zero.

  • Check frame zero and a mid-clip frame near frame 120 for every clip. Reject letterbox or pillarbox bars in either frame, even when frame zero alone looks clean.

  • Reject pour, steam, and visible flowing water in a clip, even when the pour or steam is the concept itself. Rewrite the scene without that element instead of retrying the same prompt, because the reversed ping-pong half makes directional motion run backward.

  • When letterbox bars persist across a versioned redo, change the composition entirely instead of repeating the letterbox clause.

  • When a redo is rejected as a twin (a duplicated or triptych character appearing where the concept has one figure — see docs/GLOSARIUM.md), use a wide shot with one small back-to-camera figure in an empty scene and assert one figure only.

  • Lip QA on every clip (doctrine v1.1; "idea 9" is an unresolved reference to the external doctrine document — the rule itself is stated in full here): a 2x zoom strip on the mouth at 0/25/50/75/100% must show closed lips throughout; check the generated clip's audio and reject the clip if anything vocal-like appears, even without clear words; watch the reversed half of the ping-pong master specifically for direction violations (rain rising, steam falling).

  • Reject a clip with a duplicated or triptych character, a second person in the background, letterbox or pillarbox bars, a vertical crop with blurred side panels, or an editor watermark.

  • Redo a rejected clip with explicit wording for one character only, no mirror, no reflection, no duplication and an empty location.

  • Read back the redo manifest before launching any redo and verify it contains the corrected scene and the verbatim identity lock.

  • Fix the redo file first if the read-back shows the original scene unchanged and never launch a redo on the assumption that an edit succeeded.

  • Re-paste the verbatim identity lock on an identity-drift redo and add the explicit correction for the drifted trait instead of relying on the scene edit alone.

  • Treat a mirror or window reflection, signage text, a doll or a statue as a property and not as a second person unless it forms a distinct person.

  • Judge a clip clean only on the stated criteria and record any remaining optional detail defect separately with an explicit redo offer instead of silently passing it.

  • Version every redo as v2 or v3 and never count a defective version as a final version.

Master and count only verified finals

  • Build each master as a ping-pong lossless loop and gate it on SSIM 1.0 between the end frame and the start frame plus matching md5 values for the first and last decoded frames.

  • Keep masters in their own folder apart from previews and keep defective versions out of the final folder.

  • Count the final pack only from master files verified on disk and never from a chat transcript or cross-chat memory when chat access cannot reach the other conversation.

  • Log the starting quota, the ending quota and the total spend beside the batch log so the next pack plans from real numbers.

  • When delivery needs an approval card, run upload plus md5 verification plus share plus Sheet write plus read-back in one execution per channel. Hold verified masters without relaunching while the user is offline, because approval cards expire and restarts kill waiting runs. (Card lifetime is BELUM TERVERIFIKASI / unverified: about one hour in this skill's evidence, 30 minutes in the author's main notes. Working rule: treat a card as valid for one execution only; finish the batch in a single parallel execution.) Relaunch once in one batched run when the user is online.

Available connectors

  • Kein (a custom connector, local to the author's workspace — not in this repo) for submitting, polling, and downloading Kein OMNI 1.1 generations without pasting an API key. Set it up with the Custom Connectors and MCPs system skill.

  • Use muse.connector_search to find other connectors and muse.skill_search to find related skills.

  • If nothing here fits, look on the web for a maintained API or MCP server and set it up with Custom Connectors and MCPs, or build a custom connector.

Websites

  • KEIN for the dashboard quota check, the task history and the key label check. Carry the pack prompts and the batch log into the work and verify the quota, the task status and the finished files there.

Alternatives for better results

  • If the API route is unavailable, fall back to the Google Flow browser loop pack method in flow_video_loop_pack and keep one credit log per route.

  • If a concept keeps failing policy review, redesign the flagged element instead of retrying the same prompt because identical retries fail the same way.

  • If a single concept keeps failing frame QA after a versioned redo, replace its location or its movement while keeping the character identity text unchanged.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

相关技能