Skip to content

Commit bb416a1

Browse files
authored
Merge pull request #2979 from heygen-com/docs/rewrite-guides
docs: rewrite the guides and landing pages
2 parents 8e41fa1 + f720eb7 commit bb416a1

24 files changed

Lines changed: 1543 additions & 3938 deletions

docs/examples.mdx

Lines changed: 90 additions & 257 deletions
Large diffs are not rendered by default.

docs/guides/4k-rendering.mdx

Lines changed: 44 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,70 @@
11
---
2-
title: 4K Rendering
3-
description: "Render any composition to 4K (3840×2160) without rewriting it — the CLI supersamples a 1080p composition via Chrome's device scale factor."
2+
title: Render in 4K
3+
description: Author at 4K or supersample an existing composition at render time.
44
---
55

6-
Hyperframes renders to 4K (3840×2160) two ways. Both produce a true 4K MP4; pick the one that matches your project.
7-
8-
<CardGroup cols={2}>
9-
<Card title="Author at 4K" icon="ruler">
10-
Scaffold the project at 4K so the composition is laid out at 4K natively. Best when you want crisp 4K-native typography and assets.
11-
```bash
12-
npx hyperframes init my-video --resolution 4k
13-
```
14-
</Card>
15-
<Card title="Supersample at render" icon="up-right-and-down-left-from-center">
16-
Keep your existing 1080p composition. Pass `--resolution 4k` at render time and Chrome renders at 2× DPR so the screenshot lands at 4K.
17-
```bash
18-
npx hyperframes render --resolution 4k --output 4k.mp4
19-
```
20-
</Card>
21-
</CardGroup>
22-
23-
## Quickstart
24-
25-
<Steps>
26-
<Step title="Render an existing project at 4K">
27-
```bash Terminal
28-
npx hyperframes render --resolution 4k --output my-video-4k.mp4
29-
```
30-
31-
The composition's `data-width` / `data-height` are unchanged. Chrome's `deviceScaleFactor` is set to `2`, so the captured screenshot for each frame is 3840×2160. ffmpeg auto-detects the dimensions from the screenshot stream and encodes at 4K.
32-
</Step>
33-
<Step title="Or scaffold a new project at 4K">
34-
```bash Terminal
35-
npx hyperframes init my-video --resolution 4k
36-
```
37-
38-
Every scaffolded HTML file is patched in place: `data-width="3840"`, `data-height="2160"`, `data-resolution="landscape-4k"`, `#stage` CSS dimensions, and the `<meta viewport>` tag.
39-
</Step>
40-
<Step title="Verify the output is 4K">
41-
```bash Terminal
42-
ffprobe -v error -select_streams v:0 -show_entries stream=width,height my-video-4k.mp4
43-
```
44-
45-
Expected:
46-
```
47-
width=3840
48-
height=2160
49-
```
50-
</Step>
51-
</Steps>
52-
53-
## Resolution presets
54-
55-
`--resolution` accepts these values on both `init` and `render`:
56-
57-
| Preset | Dimensions | Aliases |
58-
|--------|-----------|---------|
59-
| `landscape` | 1920×1080 | `1080p`, `hd` |
60-
| `portrait` | 1080×1920 | `1080p-portrait` |
61-
| `square` | 1080×1080 | `1080p-square`, `square-1080p` |
62-
| `landscape-4k` | 3840×2160 | `4k`, `uhd` |
63-
| `portrait-4k` | 2160×3840 | `4k-portrait` |
64-
| `square-4k` | 2160×2160 | `4k-square` |
65-
66-
Examples:
67-
68-
```bash Terminal
69-
npx hyperframes render --resolution 4k # landscape 4K
70-
npx hyperframes render --resolution portrait-4k # vertical 4K (TikTok / Reels at max quality)
71-
npx hyperframes render --resolution 1080p # explicit 1080p (no-op on 1080p compositions)
72-
```
73-
74-
## How `--resolution` works (supersampling)
75-
76-
The composition stays at its authored dimensions. Hyperframes computes a `deviceScaleFactor` from the ratio of output to composition dimensions and passes it to Chrome:
77-
78-
| Composition | `--resolution` | `deviceScaleFactor` | Output |
79-
|-------------|---------------|--------------------|--------|
80-
| 1920×1080 | `4k` | 2 | 3840×2160 |
81-
| 1080×1920 | `portrait-4k` | 2 | 2160×3840 |
82-
| 3840×2160 | `4k` | 1 (no-op) | 3840×2160 |
83-
84-
Chrome then renders the page at the higher DPR — effectively rendering each CSS pixel as 2×2 device pixels — so the captured screenshot is at the requested resolution.
6+
## Render an existing project in 4K
857

86-
<Tip>
87-
This approach is intentionally simple — no composition edits, no second authoring pass. The tradeoff: 4K renders take roughly 4× as long per frame because there are 4× the pixels to capture and encode.
88-
</Tip>
89-
90-
## What scales, what doesn't
91-
92-
Supersampling re-renders the page at higher DPR. That genuinely helps anything the browser rasterizes from a vector or high-resolution source, and does nothing for content already locked to a fixed pixel grid. Knowing which is which sets correct expectations before a 4K render:
8+
```bash
9+
npx hyperframes render --resolution 4k --output final-4k.mp4
10+
```
9311

94-
| Asset type | Behavior at `--resolution 4k` |
95-
|------------|------------------------------|
96-
| Text (HTML, SVG `<text>`, web fonts) |**Re-rasterized at 4K.** Glyphs are vector and the browser shapes/rasterizes them at the new DPR. Crisp at any scale. |
97-
| SVG / vector graphics |**Re-rasterized at 4K.** Same story as text — paths are vector. |
98-
| CSS shapes, gradients, borders, shadows |**Re-rasterized at 4K.** Browser-generated raster. |
99-
| Images with intrinsic dimensions ≥ 4K |**Full benefit.** A 3840×2160 source serves all the detail. |
100-
| Images smaller than 4K (e.g. a 1920×1080 PNG) | ⚠️ **No new detail.** Browser upscales the source bitmap; output is no sharper than rendering at 1080p and upscaling externally — but no worse either. |
101-
| `<video>` elements |**Locked to source resolution.** A 1080p MP4 stays 1080p; the supersample only helps the surrounding DOM. Encode source video at the target resolution if you need 4K throughout. |
102-
| `<canvas>` (2D and WebGL) |**Locked to canvas's intrinsic dimensions.** `<canvas width="1920" height="1080">` is a 1080p bitmap regardless of DPR. To render canvas content at 4K, multiply `canvas.width` / `canvas.height` by your target DPR and scale the drawing context (`ctx.scale(2, 2)` for a 2× canvas with the same logical layout). |
103-
| Pre-rendered video frames injected by the engine |**Locked to extraction resolution.** When the producer pre-extracts `<video>` frames via ffmpeg, they're decoded at the source video's dimensions. |
12+
HyperFrames keeps the composition's layout unchanged and captures it at a higher device-pixel ratio. A 1920×1080 composition becomes a 3840×2160 file.
10413

105-
**Rule of thumb**: if the asset is *vector or generated by the browser*, supersampling helps. If it's a *bitmap with fixed pixel dimensions* (video, canvas, low-res PNG), it doesn't — author it at the target resolution instead.
14+
Use the matching preset for portrait or square work:
10615

107-
## Constraints
16+
| Preset | Output |
17+
| --- | --- |
18+
| `4k` or `landscape-4k` | 3840×2160 |
19+
| `portrait-4k` | 2160×3840 |
20+
| `square-4k` | 2160×2160 |
10821

109-
`--resolution` enforces three guards before any frames are captured. If any fail, the render exits before doing work.
22+
## Author a project at 4K
11023

111-
### Aspect ratio must match
24+
If the project should use a 4K canvas from the start:
11225

11326
```bash
114-
# OK — both landscape
115-
hyperframes render --resolution 4k # composition is 1920×1080
116-
117-
# Error — composition is landscape, target is portrait
118-
hyperframes render --resolution portrait-4k # composition is 1920×1080
119-
# → outputResolution portrait-4k (2160×3840) does not match the aspect ratio
120-
# of the composition (1920×1080). Pick a preset whose orientation matches.
27+
npx hyperframes init my-video --resolution 4k
12128
```
12229

123-
### The scale must be an integer
124-
125-
The width ratio (output ÷ composition) must be a positive integer. 1080p → 4K is exactly ``. 720p → 4K would be `` and works. Non-integer scales like 900p → 4K (`2.4×`) introduce aliasing on subpixel-positioned text — Hyperframes refuses rather than producing a blurry render.
126-
127-
### Downsampling is not supported
128-
129-
`--resolution` only supersamples. A 4K composition cannot be downsampled to 1080p with this flag — render at the composition's native resolution and downscale separately with ffmpeg if needed.
130-
131-
### Not yet supported with `--hdr`
30+
Choose this when canvas or WebGL code, fixed-resolution media, or layout decisions need to know the final pixel dimensions while you author.
13231

133-
The HDR layered compositor processes pixel buffers at composition dimensions; supersample + HDR would need parallel scaling for those buffers. The combination is rejected with a clear error message. Render in two passes if you need both: HDR at composition resolution, then upscale separately.
32+
## What gets sharper
13433

135-
## Performance
34+
| Content | Result when supersampled |
35+
| --- | --- |
36+
| HTML text, SVG, CSS shapes, gradients | Re-rasterized at 4K |
37+
| High-resolution images | Use their available source detail |
38+
| 1080p images and video | Scaled up; no new source detail |
39+
| `<canvas>` and WebGL | Limited by the canvas's intrinsic dimensions |
13640

137-
A 1080p → 4K supersample is roughly 4× more pixels to capture, encode, and write. Expect:
41+
For a fully sharp 4K result, use 4K source media and size canvas/WebGL buffers for the target resolution.
13842

139-
- **Per-frame capture**: 3–4× slower (Chrome paints 4× the pixels and the screenshot transfer is 4× larger)
140-
- **Encoding**: 2–3× slower (depends on codec; H.264 scales sublinearly with resolution)
141-
- **Memory**: bounded — the engine's frame data-URI cache is byte-budgeted (default 1500 MB per worker, configurable via `PRODUCER_FRAME_DATA_URI_CACHE_BYTES_MB`)
142-
- **Output file size**: at the default CRF, expect 3–5× the file size of the 1080p render. Pass `--video-bitrate 25M` (or higher) for predictable file sizes.
143-
144-
For a 4K render of a 30-second composition, plan on a few minutes of wall time on a modern laptop. Add `--workers 4` (or more) on a render box for parallel capture.
43+
## Constraints
14544

146-
## Studio support
45+
`--resolution` only works when:
14746

148-
The Renders panel in Studio includes a resolution dropdown next to the format and quality selectors. Pick `4K` (or `4K ↕` for portrait) and hit **Export** — the same supersampling path runs as the CLI flag, no composition edits required.
47+
- the preset has the same aspect ratio as the composition;
48+
- the target is an integer multiple of the authored dimensions;
49+
- the target is not smaller than the composition;
50+
- the output is MP4 rather than an alpha format;
51+
- HDR is not forced for the same render.
14952

150-
The dropdown defaults to `Auto` (render at the composition's authored size). Available presets:
53+
HyperFrames checks these conditions before opening the browser. Render at the composition's native size and resize separately when a combination is unsupported.
15154

152-
- **Auto** — composition's native dimensions
153-
- **1080p ↔** / **1080p ↕** — 1920×1080 / 1080×1920
154-
- **4K ↔** / **4K ↕** — 3840×2160 / 2160×3840
55+
## Verify the file
15556

156-
The resolution applies per render, not per project — your composition files are unchanged. The same [constraints](#constraints) apply; when the producer rejects a combination, the failure surfaces in the Studio render queue.
57+
```bash
58+
ffprobe -v error -select_streams v:0 \
59+
-show_entries stream=width,height final-4k.mp4
60+
```
15761

158-
You can also drive resolution from the CLI:
62+
For landscape 4K, the output should report `3840` by `2160`.
15963

160-
- **New project**: `hyperframes init my-video --resolution 4k`
161-
- **Existing project**: `hyperframes render --resolution 4k --output 4k.mp4`
64+
4K captures four times as many pixels as 1080p, so expect more render time, memory use, and output data. Start with `--quality draft` for review, then render the approved version at the quality you need.
16265

163-
## See also
66+
## Related topics
16467

165-
- [`render` CLI reference](/packages/cli#render) — every render flag including `--video-bitrate` and `--crf`
166-
- [`init` CLI reference](/packages/cli#init) — the `--resolution` flag at scaffold time
167-
- [HDR Rendering](/guides/hdr) — color pipeline guide; HDR + 4K is not yet a supported combination
68+
- [Render from the command line](/guides/rendering)
69+
- [Improve render performance](/guides/performance)
70+
- [Deliver an HDR project](/guides/hdr)

docs/guides/authentication.mdx

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
22
title: Authentication & API keys
3-
description: "Sign in to HeyGen, and how the keys for voice, music, and capture resolve across the CLI and skills — including the priority order and the fully local fallback."
3+
description: "Sign in to HeyGen and understand how agent workflows choose voice, music, sound, and optional capture-description providers."
44
---
55

6-
HyperFrames uses a HeyGen credential for premium voiceover (TTS) and the music / sound-effects library. Other providers are optional, and **everything runs without any key** — voice and music fall back to fully local engines. This page covers signing in, the keys each capability uses, and the order they resolve.
6+
You can create and render locally without an account. Voice and music can fall
7+
back to local engines when no provider key is available. Sign in when you want
8+
HeyGen voice and music, managed cloud rendering, hosted MCP, or ownership of a
9+
published project that you can update later.
710

811
## Sign in
912

@@ -37,41 +40,68 @@ Signing in is the same OAuth step as creating an account — new users land on t
3740
The credential lives in `~/.heygen/credentials` (mode `0600`) — no per-repo `.env` to manage. Browser OAuth is a `hyperframes auth login` feature. The separate [`heygen` CLI](https://github.com/heygen-com/heygen-cli) (its own install — there's no `npx heygen`) is API-key-only, so `heygen auth login` just stores a key you paste. Both read the same `~/.heygen/credentials`, so signing in with one carries to the other.
3841

3942
<Tip>
40-
No account needed to try HyperFrames. With no credential, voice uses **Kokoro** and music uses **MusicGen**, both fully local and offline — see [Working offline](#working-offline).
43+
No account is needed to try HyperFrames locally. With no credential, voice can
44+
use **Kokoro** and music can use **MusicGen** — see [Working
45+
offline](#working-offline).
4146
</Tip>
4247

43-
## How credentials resolve
48+
## How the HeyGen credential resolves
4449

45-
The HeyGen credential drives TTS and music / SFX **retrieval**. It resolves first-match-wins:
50+
Bundled media workflows use the HeyGen credential for hosted TTS and music /
51+
sound retrieval. It resolves first-match-wins:
4652

4753
1. `HEYGEN_API_KEY` — environment variable
4854
2. `HYPERFRAMES_API_KEY` — alias, for parity with other tools
4955
3. `~/.heygen/credentials` — written by `hyperframes auth login` (or `heygen auth login`)
5056

5157
Point at a different config directory with `HEYGEN_CONFIG_DIR`, or a different backend with `HEYGEN_API_URL`.
5258

53-
## Keys by capability
59+
## Providers used by agent workflows
5460

55-
Each capability picks the **first available provider** in order; the last is always a local engine that needs no key. Cloud providers below the HeyGen line need their own key *and* a local Python dependency.
61+
After the workflow's sign-in preflight, each media capability uses the first
62+
available provider in its order. Voice, music, and sound have offline
63+
fallbacks; capture descriptions are optional and are skipped when no supported
64+
vision key is available.
5665

5766
| Capability | Provider order | Key(s) — first match wins | Local dependency |
5867
|------------|----------------|---------------------------|------------------|
5968
| **Voice (TTS)** | HeyGen → ElevenLabs → Kokoro | `HEYGEN_API_KEY``HYPERFRAMES_API_KEY``~/.heygen` · then `ELEVENLABS_API_KEY` | Kokoro: `pip install kokoro-onnx soundfile` |
6069
| **Music (BGM)** | HeyGen library → Lyria → MusicGen | HeyGen credential (above) · then `GEMINI_API_KEY``GOOGLE_API_KEY` | MusicGen: `pip install transformers torch soundfile numpy` |
6170
| **Sound effects** | HeyGen library → bundled library | HeyGen credential (above) | bundled — no deps |
62-
| **Capture descriptions** | OpenRouter → Gemini | `OPENROUTER_API_KEY``GEMINI_API_KEY` | — (optional; for [website capture](/guides/website-to-video)) |
71+
| **Capture descriptions** | OpenRouter → Gemini | `OPENROUTER_API_KEY``GEMINI_API_KEY` | None; optional for [website capture](/guides/product-launch-video) |
6372

64-
Run `npx hyperframes doctor` to check which local dependencies are installed. The media skills also run `hyperframes auth status` as a preflight before generating, so you always know whether a run will use HeyGen or a local engine before it starts.
73+
Run `npx hyperframes doctor` to check which local dependencies are installed.
74+
The media workflows run `hyperframes auth status` before generation and tell
75+
you which path they will use.
76+
77+
<Note>
78+
`npx hyperframes tts` itself is the local Kokoro CLI. Hosted HeyGen and
79+
ElevenLabs voices are selected by the bundled media workflow helpers, not by
80+
that command.
81+
</Note>
6582

6683
## Working offline
6784

68-
No key configured is a normal state, not an error. The workflow runs entirely on local models:
85+
No key configured is a normal state for local work. After their dependencies
86+
and model files are installed, these fallbacks run locally:
6987

7088
- **Voice** — Kokoro-82M (54 voices), with Whisper for word-level caption alignment.
7189
- **Music** — MusicGen (`facebook/musicgen-small`).
7290
- **Sound effects** — a bundled library.
7391

74-
Local engines are free and offline; HeyGen gives higher-quality voices and a professionally produced music library. Sign in any time to switch a project from local to HeyGen.
92+
Local engines do not call a hosted generation API after setup. Their first use
93+
may download model files. HeyGen provides managed voices and a produced music
94+
library; sign in when you want those services or cloud rendering.
95+
96+
## Publishing without an account
97+
98+
`npx hyperframes publish` works while signed out. It uploads the project and
99+
prints a URL containing a claim token. Open that URL and authenticate in the web
100+
app to claim the project.
101+
102+
Sign in with `npx hyperframes auth login` before publishing when you want the CLI
103+
to own the project immediately, update the same URL with `--update`, or publish
104+
to a shared space with `--space`.
75105

76106
## Environment variables
77107

@@ -85,4 +115,8 @@ Local engines are free and offline; HeyGen gives higher-quality voices and a pro
85115
| `GEMINI_API_KEY` / `GOOGLE_API_KEY` | Lyria music generation (and capture descriptions). |
86116
| `OPENROUTER_API_KEY` | Capture descriptions; takes priority over Gemini for that step. |
87117

88-
See the [`hyperframes auth`](/packages/cli#hyperframes-auth) command reference for subcommand details, and [Cloud rendering](/deploy/cloud) for using the same credential to render in HeyGen's cloud.
118+
## Related topics
119+
120+
- [Open the authentication command reference](/packages/cli#hyperframes-auth)
121+
- [Render with HyperFrames Cloud](/deploy/cloud)
122+
- [Choose where to create](/guides/choose-creation-path)

docs/guides/claude-design-hyperframes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ composition with `-c` rather than as a bare path.
523523
npx hyperframes render -o output.mp4
524524
```
525525

526-
1920x1080 / 30fps by default. Use `--fps 60` or `--resolution 3840x2160` to override.
526+
1920x1080 / 30fps by default. Use `--fps 60` or `--resolution 4k` to override.
527527
````
528528

529529
### Skeleton A -- Social Reel (1080x1920, 15s, 6 scenes)
@@ -1231,8 +1231,8 @@ tl.to("#s5-headline", { backgroundSize: "100% 30%", duration: 0.6, ease: "power2
12311231
Everything critical is inlined above. These are for edge cases:
12321232

12331233
- Core composition contract (data attributes, sub-comp wiring): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes/SKILL.md
1234-
- Motion theory (easing as emotion, direction rules): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes/references/motion-principles.md
1235-
- Typography (full banned list, weight contrast, OpenType): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes/references/typography.md
1236-
- Transitions (shader catalog, CSS transition patterns): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes/references/transitions.md
1237-
- Captions synced to audio: https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes/references/captions.md
1234+
- Motion theory (easing as emotion, direction rules): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes-creative/references/motion-principles.md
1235+
- Typography (full banned list, weight contrast, OpenType): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes-creative/references/typography.md
1236+
- Transitions (shader catalog, CSS transition patterns): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes-animation/transitions/overview.md
1237+
- Captions synced to audio: https://github.com/heygen-com/hyperframes/blob/main/skills/embedded-captions/SKILL.md
12381238
- Full docs: https://hyperframes.heygen.com/

0 commit comments

Comments
 (0)