egaki 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +167 -0
- package/dist/cli/clone-generate.d.ts +1 -0
- package/dist/cli/clone-generate.d.ts.map +1 -1
- package/dist/cli/clone-generate.js +1 -1
- package/dist/cli/generate.d.ts +3 -1
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +12 -5
- package/dist/cli/model-catalog.d.ts.map +1 -1
- package/dist/cli/model-catalog.js +37 -0
- package/dist/cli/upscale-generate.d.ts +97 -0
- package/dist/cli/upscale-generate.d.ts.map +1 -0
- package/dist/cli/upscale-generate.js +300 -0
- package/dist/cli/upscale-generate.test.d.ts +2 -0
- package/dist/cli/upscale-generate.test.d.ts.map +1 -0
- package/dist/cli/upscale-generate.test.js +92 -0
- package/dist/cli/voice-change-generate.d.ts +39 -0
- package/dist/cli/voice-change-generate.d.ts.map +1 -0
- package/dist/cli/voice-change-generate.js +123 -0
- package/dist/vite/angled-screen-shader.d.ts +4 -39
- package/dist/vite/angled-screen-shader.d.ts.map +1 -1
- package/dist/vite/angled-screen-shader.js +36 -440
- package/dist/vite/angled-screen.d.ts.map +1 -1
- package/dist/vite/angled-screen.js +9 -7
- package/dist/vite/shader-renderer.d.ts +0 -4
- package/dist/vite/shader-renderer.d.ts.map +1 -1
- package/dist/vite/shader-renderer.js +2 -66
- package/package.json +10 -5
- package/src/cli/cli.ts +227 -0
- package/src/cli/clone-generate.ts +1 -1
- package/src/cli/generate.ts +18 -6
- package/src/cli/model-catalog.ts +39 -0
- package/src/cli/upscale-generate.test.ts +96 -0
- package/src/cli/upscale-generate.ts +395 -0
- package/src/cli/voice-change-generate.ts +187 -0
- package/src/vite/angled-screen-shader.tsx +45 -498
- package/src/vite/angled-screen.tsx +9 -7
- package/src/vite/shader-renderer.tsx +7 -78
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
// Image upscaling for `egaki upscale`. Two kinds of upscalers:
|
|
2
|
+
//
|
|
3
|
+
// gpt-image-2* re-renders the input at a larger custom size with a strict
|
|
4
|
+
// "same image, more pixels" prompt, then color-matches it to
|
|
5
|
+
// the input. OpenAI key: one call. ChatGPT login: overlapping
|
|
6
|
+
// tiles, because that backend returns ~1.6 MP per call
|
|
7
|
+
// midjourney* registers the image as a midjourney.com editor upload, then
|
|
8
|
+
// runs Midjourney's 2x subtle or creative upscaler through the
|
|
9
|
+
// user's Chrome (@egaki/midjourney + Playwriter)
|
|
10
|
+
//
|
|
11
|
+
// Research on other upscale APIs (fal, Replicate, Topaz, ...): docs/upscale-apis.md
|
|
12
|
+
import sharp from 'sharp';
|
|
13
|
+
import dedent from 'string-dedent';
|
|
14
|
+
import { generateImageUncached, ValidationError } from './generate.js';
|
|
15
|
+
import { CATALOG } from './model-catalog.js';
|
|
16
|
+
import { shouldUseChatGptBackend } from './credentials.js';
|
|
17
|
+
export const MIDJOURNEY_UPSCALE_MODELS = ['midjourney', 'midjourney-creative'];
|
|
18
|
+
export const DEFAULT_UPSCALE_MODEL = 'gpt-image-2.6-sunburst';
|
|
19
|
+
/** GPT Image models that accept custom WIDTHxHEIGHT sizes. */
|
|
20
|
+
export const GPT_UPSCALE_MODELS = CATALOG
|
|
21
|
+
.map((m) => m.id)
|
|
22
|
+
.filter((id) => id.startsWith('gpt-image-2'));
|
|
23
|
+
export const UPSCALE_MODELS = [...GPT_UPSCALE_MODELS, ...MIDJOURNEY_UPSCALE_MODELS];
|
|
24
|
+
// https://developers.openai.com/api/docs/guides/image-generation#size-and-quality-options
|
|
25
|
+
const GPT_SIZE_MULTIPLE = 16;
|
|
26
|
+
const GPT_MAX_EDGE = 3840;
|
|
27
|
+
const GPT_MIN_PIXELS = 655_360;
|
|
28
|
+
const GPT_MAX_PIXELS = 8_294_400;
|
|
29
|
+
const GPT_MAX_RATIO = 3;
|
|
30
|
+
/**
|
|
31
|
+
* Pick the GPT Image output size for an upscale: the input scaled by `scale`
|
|
32
|
+
* (or as large as allowed), snapped to multiples of 16, inside the model limits,
|
|
33
|
+
* keeping the aspect ratio as close as the 16px grid allows.
|
|
34
|
+
*/
|
|
35
|
+
export function gptUpscaleSize({ width, height, scale, }) {
|
|
36
|
+
const ratio = width / height;
|
|
37
|
+
if (Math.max(ratio, 1 / ratio) > GPT_MAX_RATIO) {
|
|
38
|
+
return new ValidationError(`GPT Image supports aspect ratios up to ${GPT_MAX_RATIO}:1. The input is ${width}x${height}.`);
|
|
39
|
+
}
|
|
40
|
+
if (scale !== undefined && !(scale > 1)) {
|
|
41
|
+
return new ValidationError(`Scale must be greater than 1, got ${scale}.`);
|
|
42
|
+
}
|
|
43
|
+
const area = width * height;
|
|
44
|
+
const targetArea = scale === undefined ? GPT_MAX_PIXELS : area * scale * scale;
|
|
45
|
+
// Try every long edge on the 16px grid, keep the valid size closest in area to the target.
|
|
46
|
+
const landscape = width >= height;
|
|
47
|
+
const longRatio = landscape ? ratio : 1 / ratio;
|
|
48
|
+
let best;
|
|
49
|
+
for (let long = GPT_SIZE_MULTIPLE; long <= GPT_MAX_EDGE; long += GPT_SIZE_MULTIPLE) {
|
|
50
|
+
const short = Math.max(GPT_SIZE_MULTIPLE, Math.round(long / longRatio / GPT_SIZE_MULTIPLE) * GPT_SIZE_MULTIPLE);
|
|
51
|
+
const pixels = long * short;
|
|
52
|
+
if (pixels < GPT_MIN_PIXELS || pixels > GPT_MAX_PIXELS || long / short > GPT_MAX_RATIO)
|
|
53
|
+
continue;
|
|
54
|
+
if (!best || Math.abs(pixels - targetArea) < Math.abs(best.width * best.height - targetArea)) {
|
|
55
|
+
best = landscape ? { width: long, height: short } : { width: short, height: long };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (!best || best.width * best.height <= area) {
|
|
59
|
+
return new ValidationError(`GPT Image cannot upscale a ${width}x${height} image: its output is limited to ${GPT_MAX_EDGE}px per edge and ${(GPT_MAX_PIXELS / 1e6).toFixed(1)} MP.`);
|
|
60
|
+
}
|
|
61
|
+
return best;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Prompt for GPT Image upscales. Structure from the common ChatGPT upscale
|
|
65
|
+
* templates: action, keep list, allowed improvements, forbidden changes.
|
|
66
|
+
* See docs/upscale-apis.md for sources.
|
|
67
|
+
*/
|
|
68
|
+
export function gptUpscalePrompt({ width, height, extra, }) {
|
|
69
|
+
const prompt = dedent `
|
|
70
|
+
Upscale this image to ${width}x${height} pixels. This is a resolution upscale, not an edit: return the exact same image with more pixels and finer detail.
|
|
71
|
+
|
|
72
|
+
Keep everything identical to the input: composition, framing, crop and aspect ratio; the position, size, shape and proportions of every element; perspective and horizon line; colors, white balance, contrast and lighting; shadows and highlights; medium and style (brushwork, film grain, line art, paper or canvas texture); all text, letters and logos character for character; faces, identity and expressions.
|
|
73
|
+
|
|
74
|
+
Improve only resolution and definition: render crisp edges, fine textures and small details that are consistent with what is already visible, as if the same image had been captured or painted at a higher resolution. Remove blur, noise, JPEG compression artifacts and color banding.
|
|
75
|
+
|
|
76
|
+
Do not add, remove, move, restyle or reinterpret anything. No new objects, no recoloring, no relighting, no reframing, no cropping, no borders, no oversharpening halos, no plastic smoothing, no stylization.
|
|
77
|
+
`;
|
|
78
|
+
return extra?.trim() ? `${prompt}\n\nAdditional instructions: ${extra.trim()}` : prompt;
|
|
79
|
+
}
|
|
80
|
+
// The ChatGPT subscription backend ignores `size` and `quality` and returns about
|
|
81
|
+
// 1536x1024 worth of pixels in the input aspect ratio (verified Nov 2026, see
|
|
82
|
+
// docs/chatgpt-codex-image-backend.md). To reach the target size there, the
|
|
83
|
+
// input is split into overlapping tiles, each tile is upscaled, then blended.
|
|
84
|
+
const CHATGPT_MAX_PIXELS = 1536 * 1024;
|
|
85
|
+
const MAX_GRID = 4;
|
|
86
|
+
const TILE_OVERLAP = 0.2;
|
|
87
|
+
const MIN_TILE_SIDE = 192;
|
|
88
|
+
/** Split an image into grid x grid tiles that overlap by TILE_OVERLAP of a tile. */
|
|
89
|
+
export function planTiles({ width, height, grid }) {
|
|
90
|
+
const tileWidth = Math.round(width / (grid - (grid - 1) * TILE_OVERLAP));
|
|
91
|
+
const tileHeight = Math.round(height / (grid - (grid - 1) * TILE_OVERLAP));
|
|
92
|
+
const offsets = (size, tile) => Array.from({ length: grid }, (_, i) => (grid === 1 ? 0 : Math.round((i * (size - tile)) / (grid - 1))));
|
|
93
|
+
return offsets(height, tileHeight).flatMap((y) => offsets(width, tileWidth).map((x) => ({ x, y, width: tileWidth, height: tileHeight })));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Smallest grid whose tiles, each returned at `pixelsPerCall`, reach the target
|
|
97
|
+
* width. Stops before tiles get under MIN_TILE_SIDE, where the model sees too
|
|
98
|
+
* little context and invents detail.
|
|
99
|
+
*/
|
|
100
|
+
export function chooseGrid({ width, height, targetWidth, pixelsPerCall, }) {
|
|
101
|
+
let grid = 1;
|
|
102
|
+
while (grid < MAX_GRID) {
|
|
103
|
+
const tile = planTiles({ width, height, grid })[0];
|
|
104
|
+
if (width * Math.sqrt(pixelsPerCall / (tile.width * tile.height)) >= targetWidth)
|
|
105
|
+
return grid;
|
|
106
|
+
const next = planTiles({ width, height, grid: grid + 1 })[0];
|
|
107
|
+
if (Math.min(next.width, next.height) < MIN_TILE_SIDE)
|
|
108
|
+
return grid;
|
|
109
|
+
grid++;
|
|
110
|
+
}
|
|
111
|
+
return grid;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Blend upscaled RGB tiles (output coordinates) into one image. Each tile is
|
|
115
|
+
* matched to the reference (the input resized to the output size) by
|
|
116
|
+
* per-channel mean and standard deviation, which removes the color drift
|
|
117
|
+
* generative models add, then feathered across the overlaps.
|
|
118
|
+
*/
|
|
119
|
+
export function blendTiles({ width, height, reference, tiles, }) {
|
|
120
|
+
const sum = new Float32Array(width * height * 3);
|
|
121
|
+
const weight = new Float32Array(width * height);
|
|
122
|
+
for (const tile of tiles) {
|
|
123
|
+
const count = tile.width * tile.height;
|
|
124
|
+
const channelStats = (read) => [0, 1, 2].map((c) => {
|
|
125
|
+
let total = 0;
|
|
126
|
+
let squares = 0;
|
|
127
|
+
for (let p = 0; p < count; p++) {
|
|
128
|
+
const v = read(p, c);
|
|
129
|
+
total += v;
|
|
130
|
+
squares += v * v;
|
|
131
|
+
}
|
|
132
|
+
const mean = total / count;
|
|
133
|
+
return { mean, std: Math.sqrt(Math.max(1, squares / count - mean * mean)) };
|
|
134
|
+
});
|
|
135
|
+
const target = channelStats((p, c) => reference[((tile.y + Math.floor(p / tile.width)) * width + tile.x + (p % tile.width)) * 3 + c]);
|
|
136
|
+
const actual = channelStats((p, c) => tile.pixels[p * 3 + c]);
|
|
137
|
+
// weights ramp to 0 only on sides that overlap a neighbor tile
|
|
138
|
+
const rampX = tile.width * TILE_OVERLAP;
|
|
139
|
+
const rampY = tile.height * TILE_OVERLAP;
|
|
140
|
+
for (let py = 0; py < tile.height; py++) {
|
|
141
|
+
const top = tile.y > 0 ? py / rampY : 1;
|
|
142
|
+
const bottom = tile.y + tile.height < height ? (tile.height - 1 - py) / rampY : 1;
|
|
143
|
+
for (let px = 0; px < tile.width; px++) {
|
|
144
|
+
const left = tile.x > 0 ? px / rampX : 1;
|
|
145
|
+
const right = tile.x + tile.width < width ? (tile.width - 1 - px) / rampX : 1;
|
|
146
|
+
const w = Math.max(1e-4, Math.min(1, top, bottom, left, right));
|
|
147
|
+
const o = (tile.y + py) * width + tile.x + px;
|
|
148
|
+
for (let c = 0; c < 3; c++) {
|
|
149
|
+
const v = tile.pixels[(py * tile.width + px) * 3 + c];
|
|
150
|
+
sum[o * 3 + c] += (((v - actual[c].mean) / actual[c].std) * target[c].std + target[c].mean) * w;
|
|
151
|
+
}
|
|
152
|
+
weight[o] += w;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const out = new Uint8Array(width * height * 3);
|
|
157
|
+
for (let o = 0; o < width * height; o++) {
|
|
158
|
+
for (let c = 0; c < 3; c++)
|
|
159
|
+
out[o * 3 + c] = Math.max(0, Math.min(255, Math.round(sum[o * 3 + c] / weight[o])));
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
163
|
+
// sharp and @egaki/midjourney reject with Error instances
|
|
164
|
+
const toError = (err) => err;
|
|
165
|
+
async function readImageSize(bytes) {
|
|
166
|
+
const meta = await sharp(bytes).metadata().catch(toError);
|
|
167
|
+
if (meta instanceof Error)
|
|
168
|
+
return new ValidationError(`Could not read the image: ${meta.message}`);
|
|
169
|
+
return meta.autoOrient;
|
|
170
|
+
}
|
|
171
|
+
export async function upscaleImageUncached(opts) {
|
|
172
|
+
const model = opts.model ?? DEFAULT_UPSCALE_MODEL;
|
|
173
|
+
if (model === 'midjourney' || model === 'midjourney-creative') {
|
|
174
|
+
if (opts.scale !== undefined && opts.scale !== 2) {
|
|
175
|
+
return new ValidationError('Midjourney only upscales 2x. Remove --scale or pass --scale 2.');
|
|
176
|
+
}
|
|
177
|
+
const input = await readImageSize(opts.image);
|
|
178
|
+
if (input instanceof Error)
|
|
179
|
+
return input;
|
|
180
|
+
return upscaleWithMidjourney({ image: opts.image, model, input, prompt: opts.prompt });
|
|
181
|
+
}
|
|
182
|
+
if (!GPT_UPSCALE_MODELS.includes(model)) {
|
|
183
|
+
return new ValidationError(`Model ${model} cannot upscale. Use one of: ${UPSCALE_MODELS.join(', ')}`);
|
|
184
|
+
}
|
|
185
|
+
return upscaleWithGpt({ image: opts.image, model, scale: opts.scale, extra: opts.prompt });
|
|
186
|
+
}
|
|
187
|
+
async function upscaleWithGpt(opts) {
|
|
188
|
+
const decoded = await sharp(opts.image)
|
|
189
|
+
.autoOrient()
|
|
190
|
+
.removeAlpha()
|
|
191
|
+
.toColourspace('srgb')
|
|
192
|
+
.raw()
|
|
193
|
+
.toBuffer({ resolveWithObject: true })
|
|
194
|
+
.catch(toError);
|
|
195
|
+
if (decoded instanceof Error)
|
|
196
|
+
return new ValidationError(`Could not read the image: ${decoded.message}`);
|
|
197
|
+
const input = { width: decoded.info.width, height: decoded.info.height };
|
|
198
|
+
const raw = { raw: { width: input.width, height: input.height, channels: 3 } };
|
|
199
|
+
const size = gptUpscaleSize({ ...input, scale: opts.scale });
|
|
200
|
+
if (size instanceof Error)
|
|
201
|
+
return size;
|
|
202
|
+
// with an API key one call returns the full size; ChatGPT login needs tiles
|
|
203
|
+
const grid = shouldUseChatGptBackend()
|
|
204
|
+
? chooseGrid({ ...input, targetWidth: size.width, pixelsPerCall: CHATGPT_MAX_PIXELS })
|
|
205
|
+
: 1;
|
|
206
|
+
const tiles = planTiles({ ...input, grid });
|
|
207
|
+
const sx = size.width / input.width;
|
|
208
|
+
const sy = size.height / input.height;
|
|
209
|
+
const extra = grid > 1
|
|
210
|
+
? ['This image is a crop of a larger image: content continues past every edge, so add no borders or vignettes.', opts.extra].filter(Boolean).join(' ')
|
|
211
|
+
: opts.extra;
|
|
212
|
+
const reference = await sharp(decoded.data, raw)
|
|
213
|
+
.resize(size.width, size.height, { fit: 'fill', kernel: 'lanczos3' })
|
|
214
|
+
.raw()
|
|
215
|
+
.toBuffer();
|
|
216
|
+
const prompts = [];
|
|
217
|
+
const upscaled = await Promise.all(tiles.map(async (tile) => {
|
|
218
|
+
const x = Math.round(tile.x * sx);
|
|
219
|
+
const y = Math.round(tile.y * sy);
|
|
220
|
+
const box = { x, y, width: Math.round((tile.x + tile.width) * sx) - x, height: Math.round((tile.y + tile.height) * sy) - y };
|
|
221
|
+
const crop = await sharp(decoded.data, raw)
|
|
222
|
+
.extract({ left: tile.x, top: tile.y, width: tile.width, height: tile.height })
|
|
223
|
+
.png()
|
|
224
|
+
.toBuffer();
|
|
225
|
+
const prompt = gptUpscalePrompt({ width: box.width, height: box.height, extra });
|
|
226
|
+
prompts.push(prompt);
|
|
227
|
+
const request = () => generateImageUncached({
|
|
228
|
+
prompt,
|
|
229
|
+
model: opts.model,
|
|
230
|
+
inputImages: [new Uint8Array(crop)],
|
|
231
|
+
// the ChatGPT backend ignores size; only send it when it is a valid API size
|
|
232
|
+
size: grid === 1 ? `${box.width}x${box.height}` : undefined,
|
|
233
|
+
quality: 'high',
|
|
234
|
+
});
|
|
235
|
+
// one retry: with many parallel tiles a single transient failure is likely
|
|
236
|
+
let result = await request();
|
|
237
|
+
if (result instanceof Error && !(result instanceof ValidationError))
|
|
238
|
+
result = await request();
|
|
239
|
+
if (result instanceof Error)
|
|
240
|
+
return result;
|
|
241
|
+
const file = result.images[0];
|
|
242
|
+
if (!file)
|
|
243
|
+
return new Error('GPT Image returned no image.');
|
|
244
|
+
const returned = await sharp(file.uint8Array).metadata().catch(toError);
|
|
245
|
+
if (returned instanceof Error)
|
|
246
|
+
return returned;
|
|
247
|
+
const pixels = await sharp(file.uint8Array)
|
|
248
|
+
.removeAlpha()
|
|
249
|
+
.resize(box.width, box.height, { fit: 'fill', kernel: 'lanczos3' })
|
|
250
|
+
.raw()
|
|
251
|
+
.toBuffer()
|
|
252
|
+
.catch(toError);
|
|
253
|
+
if (pixels instanceof Error)
|
|
254
|
+
return pixels;
|
|
255
|
+
return { ...box, pixels, returned: { width: returned.width, height: returned.height }, cost: result.cost };
|
|
256
|
+
}));
|
|
257
|
+
const done = [];
|
|
258
|
+
for (const tile of upscaled) {
|
|
259
|
+
if (tile instanceof Error)
|
|
260
|
+
return tile;
|
|
261
|
+
done.push(tile);
|
|
262
|
+
}
|
|
263
|
+
const pixels = blendTiles({ ...size, reference, tiles: done });
|
|
264
|
+
const png = await sharp(pixels, { raw: { ...size, channels: 3 } }).png().toBuffer();
|
|
265
|
+
const small = done.find((tile) => tile.returned.width * tile.returned.height < tile.width * tile.height * 0.9);
|
|
266
|
+
const costs = done.map((tile) => tile.cost);
|
|
267
|
+
return {
|
|
268
|
+
image: { uint8Array: new Uint8Array(png), mediaType: 'image/png' },
|
|
269
|
+
model: opts.model,
|
|
270
|
+
input,
|
|
271
|
+
output: size,
|
|
272
|
+
tiles: tiles.length,
|
|
273
|
+
prompt: prompts[0],
|
|
274
|
+
warning: small
|
|
275
|
+
? `GPT Image returned ${small.returned.width}x${small.returned.height} for a ${small.width}x${small.height} tile, so tiles were resized up and look softer.`
|
|
276
|
+
: undefined,
|
|
277
|
+
cost: costs.every((cost) => cost !== null) ? costs.reduce((a, b) => a + b, 0) : null,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
async function upscaleWithMidjourney(opts) {
|
|
281
|
+
const { Midjourney } = await import('@egaki/midjourney');
|
|
282
|
+
const mj = new Midjourney();
|
|
283
|
+
const result = await mj
|
|
284
|
+
.upscaleImage(Buffer.from(opts.image), {
|
|
285
|
+
type: opts.model === 'midjourney-creative' ? 'v7_2x_creative' : 'v7_2x_subtle',
|
|
286
|
+
prompt: opts.prompt,
|
|
287
|
+
})
|
|
288
|
+
.catch(toError);
|
|
289
|
+
await mj.close().catch(() => { });
|
|
290
|
+
if (result instanceof Error)
|
|
291
|
+
return result;
|
|
292
|
+
return {
|
|
293
|
+
image: { uint8Array: new Uint8Array(result.image), mediaType: 'image/jpeg' },
|
|
294
|
+
model: opts.model,
|
|
295
|
+
input: opts.input,
|
|
296
|
+
output: { width: result.width, height: result.height },
|
|
297
|
+
jobId: result.upscaleJobId,
|
|
298
|
+
cost: null,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upscale-generate.test.d.ts","sourceRoot":"","sources":["../../src/cli/upscale-generate.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { blendTiles, chooseGrid, gptUpscaleSize, planTiles } from './upscale-generate.js';
|
|
3
|
+
describe('gptUpscaleSize', () => {
|
|
4
|
+
test('picks a size inside every GPT Image limit, close to the requested scale', () => {
|
|
5
|
+
const cases = [
|
|
6
|
+
{ width: 992, height: 570 },
|
|
7
|
+
{ width: 992, height: 570, scale: 2 },
|
|
8
|
+
{ width: 1024, height: 1024 },
|
|
9
|
+
{ width: 1080, height: 1920 },
|
|
10
|
+
{ width: 3000, height: 1000 },
|
|
11
|
+
{ width: 400, height: 300, scale: 1.5 },
|
|
12
|
+
{ width: 600, height: 200, scale: 2 },
|
|
13
|
+
{ width: 4000, height: 3000, scale: 2 },
|
|
14
|
+
{ width: 3100, height: 1000 },
|
|
15
|
+
{ width: 800, height: 600, scale: 0.5 },
|
|
16
|
+
];
|
|
17
|
+
const results = cases.map((input) => {
|
|
18
|
+
const label = `${input.width}x${input.height} x${input.scale ?? 'max'}`;
|
|
19
|
+
const size = gptUpscaleSize(input);
|
|
20
|
+
if (size instanceof Error)
|
|
21
|
+
return `${label}: ${size.message}`;
|
|
22
|
+
const pixels = size.width * size.height;
|
|
23
|
+
const valid = size.width % 16 === 0 &&
|
|
24
|
+
size.height % 16 === 0 &&
|
|
25
|
+
Math.max(size.width, size.height) <= 3840 &&
|
|
26
|
+
pixels >= 655_360 &&
|
|
27
|
+
pixels <= 8_294_400 &&
|
|
28
|
+
Math.max(size.width / size.height, size.height / size.width) <= 3;
|
|
29
|
+
const ratioDrift = Math.abs(size.width / size.height / (input.width / input.height) - 1);
|
|
30
|
+
return `${label} -> ${size.width}x${size.height} (${(pixels / 1e6).toFixed(2)} MP, ratio drift ${(ratioDrift * 100).toFixed(2)}%${valid ? '' : ', INVALID'})`;
|
|
31
|
+
});
|
|
32
|
+
expect('\n' + results.join('\n')).toMatchInlineSnapshot(`
|
|
33
|
+
"
|
|
34
|
+
992x570 xmax -> 3792x2176 (8.25 MP, ratio drift 0.13%)
|
|
35
|
+
992x570 x2 -> 1984x1136 (2.25 MP, ratio drift 0.35%)
|
|
36
|
+
1024x1024 xmax -> 2880x2880 (8.29 MP, ratio drift 0.00%)
|
|
37
|
+
1080x1920 xmax -> 2160x3840 (8.29 MP, ratio drift 0.00%)
|
|
38
|
+
3000x1000 xmax -> 3840x1280 (4.92 MP, ratio drift 0.00%)
|
|
39
|
+
400x300 x1.5 -> 944x704 (0.66 MP, ratio drift 0.57%)
|
|
40
|
+
600x200 x2 -> 1424x480 (0.68 MP, ratio drift 1.11%)
|
|
41
|
+
4000x3000 x2: GPT Image cannot upscale a 4000x3000 image: its output is limited to 3840px per edge and 8.3 MP.
|
|
42
|
+
3100x1000 xmax: GPT Image supports aspect ratios up to 3:1. The input is 3100x1000.
|
|
43
|
+
800x600 x0.5: Scale must be greater than 1, got 0.5."
|
|
44
|
+
`);
|
|
45
|
+
});
|
|
46
|
+
test('ChatGPT login tiles the image until ~1.6 MP per tile reaches the target', () => {
|
|
47
|
+
const cases = [
|
|
48
|
+
{ width: 992, height: 570, targetWidth: 3792 },
|
|
49
|
+
{ width: 992, height: 570, targetWidth: 1984 },
|
|
50
|
+
{ width: 1024, height: 1024, targetWidth: 2880 },
|
|
51
|
+
{ width: 300, height: 200, targetWidth: 3456 },
|
|
52
|
+
];
|
|
53
|
+
const lines = cases.map((c) => {
|
|
54
|
+
const grid = chooseGrid({ ...c, pixelsPerCall: 1536 * 1024 });
|
|
55
|
+
const tiles = planTiles({ width: c.width, height: c.height, grid });
|
|
56
|
+
const last = tiles[tiles.length - 1];
|
|
57
|
+
const covers = last.x + last.width === c.width && last.y + last.height === c.height;
|
|
58
|
+
return `${c.width}x${c.height} -> ${c.targetWidth}w: grid ${grid}, tile ${tiles[0].width}x${tiles[0].height}, covers ${covers}`;
|
|
59
|
+
});
|
|
60
|
+
expect('\n' + lines.join('\n')).toMatchInlineSnapshot(`
|
|
61
|
+
"
|
|
62
|
+
992x570 -> 3792w: grid 3, tile 382x219, covers true
|
|
63
|
+
992x570 -> 1984w: grid 2, tile 551x317, covers true
|
|
64
|
+
1024x1024 -> 2880w: grid 3, tile 394x394, covers true
|
|
65
|
+
300x200 -> 3456w: grid 1, tile 300x200, covers true"
|
|
66
|
+
`);
|
|
67
|
+
});
|
|
68
|
+
test('blendTiles maps each tile to the reference colors and keeps overlaps seamless', () => {
|
|
69
|
+
const width = 8;
|
|
70
|
+
const height = 4;
|
|
71
|
+
const reference = new Uint8Array(width * height * 3).map((_, i) => 100 + (i % 3) * 20);
|
|
72
|
+
// two overlapping tiles with a different global color cast each
|
|
73
|
+
const tile = (x, cast) => ({
|
|
74
|
+
x,
|
|
75
|
+
y: 0,
|
|
76
|
+
width: 5,
|
|
77
|
+
height,
|
|
78
|
+
pixels: new Uint8Array(5 * height * 3).map((_, i) => 100 + (i % 3) * 20 + cast + (i % 7)),
|
|
79
|
+
});
|
|
80
|
+
const out = blendTiles({ width, height, reference, tiles: [tile(0, 40), tile(3, -30)] });
|
|
81
|
+
const maxDiff = Math.max(...out.map((v, i) => Math.abs(v - reference[i])));
|
|
82
|
+
expect(maxDiff).toBeLessThanOrEqual(4);
|
|
83
|
+
// near-white areas push matched values past 255; they must clamp, not wrap to dark pixels
|
|
84
|
+
const bright = blendTiles({
|
|
85
|
+
width: 4,
|
|
86
|
+
height: 1,
|
|
87
|
+
reference: new Uint8Array([250, 250, 250, 255, 255, 255, 240, 240, 240, 255, 255, 255]),
|
|
88
|
+
tiles: [{ x: 0, y: 0, width: 4, height: 1, pixels: new Uint8Array([10, 10, 10, 200, 200, 200, 0, 0, 0, 255, 255, 255]) }],
|
|
89
|
+
});
|
|
90
|
+
expect(Math.min(...bright)).toBeGreaterThan(200);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface VoiceChangeOptions {
|
|
2
|
+
/** Raw audio bytes of the recording to re-speak. */
|
|
3
|
+
audio: Uint8Array;
|
|
4
|
+
/** Target voice ID from the provider's voice library (or a cloned voice). */
|
|
5
|
+
voice: string;
|
|
6
|
+
provider: VoiceChangeProvider;
|
|
7
|
+
/** Provider model ID. Defaults to the provider's default model. */
|
|
8
|
+
model?: string;
|
|
9
|
+
/** Original filename for MIME type inference. */
|
|
10
|
+
filename?: string;
|
|
11
|
+
/** ElevenLabs: remove background noise from the input before conversion. */
|
|
12
|
+
removeBackgroundNoise?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface VoiceChangeResult {
|
|
15
|
+
audio: Uint8Array;
|
|
16
|
+
mediaType: string;
|
|
17
|
+
provider: VoiceChangeProvider;
|
|
18
|
+
model?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function changeVoiceElevenLabs(opts: VoiceChangeOptions): Promise<Error | VoiceChangeResult>;
|
|
21
|
+
declare function changeVoiceCartesia(opts: VoiceChangeOptions): Promise<Error | VoiceChangeResult>;
|
|
22
|
+
export declare const VOICE_CHANGE_PROVIDERS: {
|
|
23
|
+
elevenlabs: {
|
|
24
|
+
models: string[];
|
|
25
|
+
defaultModel: string;
|
|
26
|
+
supportsRemoveBackgroundNoise: true;
|
|
27
|
+
change: typeof changeVoiceElevenLabs;
|
|
28
|
+
};
|
|
29
|
+
cartesia: {
|
|
30
|
+
models: never[];
|
|
31
|
+
supportsRemoveBackgroundNoise: false;
|
|
32
|
+
change: typeof changeVoiceCartesia;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type VoiceChangeProvider = keyof typeof VOICE_CHANGE_PROVIDERS;
|
|
36
|
+
export declare const VOICE_CHANGE_PROVIDER_IDS: [VoiceChangeProvider, ...VoiceChangeProvider[]];
|
|
37
|
+
export declare function changeVoiceUncached(opts: VoiceChangeOptions): Promise<Error | VoiceChangeResult>;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=voice-change-generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-change-generate.d.ts","sourceRoot":"","sources":["../../src/cli/voice-change-generate.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,KAAK,EAAE,UAAU,CAAA;IACjB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4EAA4E;IAC5E,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAwCD,iBAAe,qBAAqB,CAClC,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAwBpC;AAID,iBAAe,mBAAmB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,GAAG,iBAAiB,CAAC,CA4B/F;AAID,eAAO,MAAM,sBAAsB;;;;;;;;;;;;CAYM,CAAA;AAEzC,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,sBAAsB,CAAA;AAErE,eAAO,MAAM,yBAAyB,EAA0C,CAC9E,mBAAmB,EACnB,GAAG,mBAAmB,EAAE,CACzB,CAAA;AAID,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAsBpC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Voice change (speech-to-speech): re-speak a recording with another voice,
|
|
2
|
+
// keeping its timing, emotion and delivery. Plain multipart HTTP calls, no SDK.
|
|
3
|
+
// Returns Error | Result (errore style) instead of throwing.
|
|
4
|
+
//
|
|
5
|
+
// Each provider is one entry in VOICE_CHANGE_PROVIDERS. To add a provider,
|
|
6
|
+
// add an entry with its models and a change() function.
|
|
7
|
+
//
|
|
8
|
+
// ElevenLabs: POST https://api.elevenlabs.io/v1/voice-changer/{voice_id}
|
|
9
|
+
// Docs: https://elevenlabs.io/docs/api-reference/speech-to-speech/convert
|
|
10
|
+
//
|
|
11
|
+
// Cartesia: POST https://api.cartesia.ai/voice-changer/bytes
|
|
12
|
+
// Docs: https://docs.cartesia.ai/api-reference/voice-changer/bytes
|
|
13
|
+
import { injectCredentialsToEnv } from './credentials.js';
|
|
14
|
+
import { mimeTypeFromFilename } from './clone-generate.js';
|
|
15
|
+
import { ValidationError } from './models.js';
|
|
16
|
+
// ─── shared helpers ─────────────────────────────────────────────────────────
|
|
17
|
+
function audioFile(opts) {
|
|
18
|
+
const mime = mimeTypeFromFilename(opts.filename);
|
|
19
|
+
const ext = opts.filename?.split('.').pop() ?? 'mp3';
|
|
20
|
+
return new File([Buffer.from(opts.audio)], `input.${ext}`, { type: mime });
|
|
21
|
+
}
|
|
22
|
+
async function readAudioResponse(label, response) {
|
|
23
|
+
if (response instanceof Error)
|
|
24
|
+
return response;
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
const errorText = await response.text().catch(() => '');
|
|
27
|
+
return new Error(`${label} voice change API error ${response.status}: ${errorText || response.statusText}`);
|
|
28
|
+
}
|
|
29
|
+
const bytes = await response.arrayBuffer().catch((cause) => new Error(`${label} voice change response could not be read`, { cause }));
|
|
30
|
+
if (bytes instanceof Error)
|
|
31
|
+
return bytes;
|
|
32
|
+
if (bytes.byteLength === 0)
|
|
33
|
+
return new Error(`${label} voice change API returned empty audio`);
|
|
34
|
+
return {
|
|
35
|
+
audio: new Uint8Array(bytes),
|
|
36
|
+
mediaType: response.headers.get('content-type')?.split(';')[0] ?? 'audio/mpeg',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// ─── ElevenLabs ─────────────────────────────────────────────────────────────
|
|
40
|
+
async function changeVoiceElevenLabs(opts) {
|
|
41
|
+
const apiKey = process.env['ELEVENLABS_API_KEY'];
|
|
42
|
+
if (!apiKey) {
|
|
43
|
+
return new Error('ELEVENLABS_API_KEY not found. Run: egaki login --provider elevenlabs\n' +
|
|
44
|
+
'Get your key at https://elevenlabs.io/app/settings/api-keys');
|
|
45
|
+
}
|
|
46
|
+
const formData = new FormData();
|
|
47
|
+
formData.append('audio', audioFile(opts));
|
|
48
|
+
if (opts.model)
|
|
49
|
+
formData.append('model_id', opts.model);
|
|
50
|
+
if (opts.removeBackgroundNoise)
|
|
51
|
+
formData.append('remove_background_noise', 'true');
|
|
52
|
+
const url = `https://api.elevenlabs.io/v1/voice-changer/${encodeURIComponent(opts.voice)}?output_format=mp3_44100_128`;
|
|
53
|
+
const response = await fetch(url, {
|
|
54
|
+
method: 'POST',
|
|
55
|
+
headers: { 'xi-api-key': apiKey },
|
|
56
|
+
body: formData,
|
|
57
|
+
}).catch((cause) => new Error('ElevenLabs voice change request failed', { cause }));
|
|
58
|
+
const result = await readAudioResponse('ElevenLabs', response);
|
|
59
|
+
if (result instanceof Error)
|
|
60
|
+
return result;
|
|
61
|
+
return { ...result, provider: 'elevenlabs', model: opts.model };
|
|
62
|
+
}
|
|
63
|
+
// ─── Cartesia ───────────────────────────────────────────────────────────────
|
|
64
|
+
async function changeVoiceCartesia(opts) {
|
|
65
|
+
const apiKey = process.env['CARTESIA_API_KEY'];
|
|
66
|
+
if (!apiKey) {
|
|
67
|
+
return new Error('CARTESIA_API_KEY not found. Run: egaki login --provider cartesia\n' +
|
|
68
|
+
'Get your key at https://play.cartesia.ai/keys');
|
|
69
|
+
}
|
|
70
|
+
const formData = new FormData();
|
|
71
|
+
formData.append('clip', audioFile(opts));
|
|
72
|
+
formData.append('voice[id]', opts.voice);
|
|
73
|
+
formData.append('output_format[container]', 'mp3');
|
|
74
|
+
formData.append('output_format[sample_rate]', '44100');
|
|
75
|
+
formData.append('output_format[bit_rate]', '128000');
|
|
76
|
+
const response = await fetch('https://api.cartesia.ai/voice-changer/bytes', {
|
|
77
|
+
method: 'POST',
|
|
78
|
+
headers: {
|
|
79
|
+
'Cartesia-Version': '2026-03-01',
|
|
80
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
81
|
+
},
|
|
82
|
+
body: formData,
|
|
83
|
+
}).catch((cause) => new Error('Cartesia voice change request failed', { cause }));
|
|
84
|
+
const result = await readAudioResponse('Cartesia', response);
|
|
85
|
+
if (result instanceof Error)
|
|
86
|
+
return result;
|
|
87
|
+
return { ...result, provider: 'cartesia' };
|
|
88
|
+
}
|
|
89
|
+
// ─── provider registry ──────────────────────────────────────────────────────
|
|
90
|
+
export const VOICE_CHANGE_PROVIDERS = {
|
|
91
|
+
elevenlabs: {
|
|
92
|
+
models: ['eleven_multilingual_sts_v2', 'eleven_english_sts_v2'],
|
|
93
|
+
defaultModel: 'eleven_multilingual_sts_v2',
|
|
94
|
+
supportsRemoveBackgroundNoise: true,
|
|
95
|
+
change: changeVoiceElevenLabs,
|
|
96
|
+
},
|
|
97
|
+
cartesia: {
|
|
98
|
+
models: [],
|
|
99
|
+
supportsRemoveBackgroundNoise: false,
|
|
100
|
+
change: changeVoiceCartesia,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
export const VOICE_CHANGE_PROVIDER_IDS = Object.keys(VOICE_CHANGE_PROVIDERS);
|
|
104
|
+
// ─── main entry point ───────────────────────────────────────────────────────
|
|
105
|
+
export async function changeVoiceUncached(opts) {
|
|
106
|
+
injectCredentialsToEnv();
|
|
107
|
+
const entry = VOICE_CHANGE_PROVIDERS[opts.provider];
|
|
108
|
+
if (opts.audio.length === 0) {
|
|
109
|
+
return new ValidationError('No audio data provided. Pass an audio file or use --stdin.');
|
|
110
|
+
}
|
|
111
|
+
if (!opts.voice || opts.voice.trim().length === 0) {
|
|
112
|
+
return new ValidationError('Target voice is required. Use --voice <voice-id>.');
|
|
113
|
+
}
|
|
114
|
+
if (opts.model && !entry.models.includes(opts.model)) {
|
|
115
|
+
return new ValidationError(entry.models.length === 0
|
|
116
|
+
? `${opts.provider} voice change has no model option. Remove -m.`
|
|
117
|
+
: `Unknown ${opts.provider} voice change model "${opts.model}". Supported: ${entry.models.join(', ')}`);
|
|
118
|
+
}
|
|
119
|
+
if (opts.removeBackgroundNoise && !entry.supportsRemoveBackgroundNoise) {
|
|
120
|
+
return new ValidationError(`--remove-background-noise is not supported by ${opts.provider}.`);
|
|
121
|
+
}
|
|
122
|
+
return entry.change({ ...opts, voice: opts.voice.trim(), model: opts.model ?? entry.defaultModel });
|
|
123
|
+
}
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { type AngledScreenParams } from '@egaki/angled-screen/src';
|
|
3
|
+
/** Shader params (perspective, rotateX/Y/Z, bokeh, fog...) are documented on
|
|
4
|
+
* `AngledScreenParams` in @egaki/angled-screen. */
|
|
5
|
+
export interface AngledScreenProps extends Partial<AngledScreenParams> {
|
|
3
6
|
children: ReactNode;
|
|
4
|
-
/** CSS perspective distance in px. Smaller = more dramatic. Default 1200. */
|
|
5
|
-
perspective?: number;
|
|
6
|
-
/** X-axis rotation in degrees (tilts top/bottom). Default 8. */
|
|
7
|
-
rotateX?: number;
|
|
8
|
-
/** Y-axis rotation in degrees (angles left/right). Default -12. */
|
|
9
|
-
rotateY?: number;
|
|
10
|
-
/** Z-axis rotation in degrees. Default 0. */
|
|
11
|
-
rotateZ?: number;
|
|
12
|
-
/** Shift the plane horizontally in px. Positive = right. Default 0. */
|
|
13
|
-
translateX?: number;
|
|
14
|
-
/** Push the plane forward/back in px. Positive = closer/larger. Default 0. */
|
|
15
|
-
translateZ?: number;
|
|
16
|
-
/** Enable depth-based bokeh blur. Default true. */
|
|
17
|
-
bokeh?: boolean;
|
|
18
|
-
/** Aperture — bigger values for shallower depth of field. Blur grows
|
|
19
|
-
* linearly with distance from the focus plane, scaled by this.
|
|
20
|
-
* Same semantics as Three's BokehPass. Default 0.5 (plugin value). */
|
|
21
|
-
aperture?: number;
|
|
22
|
-
/** Max blur in screen-UV units (fraction of frame size), the saturation
|
|
23
|
-
* cap of the blur. Same as Three's `maxblur`. Default 0.12 (plugin value). */
|
|
24
|
-
maxBlur?: number;
|
|
25
|
-
/** Focus distance as a fraction of `perspective`. Default 0 = auto: focus
|
|
26
|
-
* tracks the nearest visible point of the plane, so the near side stays
|
|
27
|
-
* sharp and blur ramps progressively toward the far edge only. */
|
|
28
|
-
focus?: number;
|
|
29
|
-
/** Fog toward backgroundColor at the far depth (0-1). Default 0.35. */
|
|
30
|
-
fog?: number;
|
|
31
|
-
/** Film grain intensity. Default 0.02. */
|
|
32
|
-
grainIntensity?: number;
|
|
33
|
-
/** Chromatic aberration strength. RGB channels separate along the radial
|
|
34
|
-
* axis from frame center, scaled up by local blur so fringing reads
|
|
35
|
-
* strongest in the bokeh (like real lens CA on the reference photos).
|
|
36
|
-
* 0 = off. Default 0.45. */
|
|
37
|
-
chromaticAberration?: number;
|
|
38
|
-
/** Background color behind the tilted screen. Default '#000000'. */
|
|
39
|
-
backgroundColor?: string;
|
|
40
7
|
/** Width of the inner content wrapper. Default '80%'. */
|
|
41
8
|
width?: string | number;
|
|
42
9
|
/** Height of the inner content wrapper. Default 'auto'. */
|
|
43
10
|
height?: string | number;
|
|
44
|
-
/** Render normalized depth as grayscale for debugging the DOF ramp. */
|
|
45
|
-
debug?: boolean;
|
|
46
11
|
/** Optional inline style on the outer container. */
|
|
47
12
|
style?: CSSProperties;
|
|
48
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angled-screen-shader.d.ts","sourceRoot":"","sources":["../../src/vite/angled-screen-shader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"angled-screen-shader.d.ts","sourceRoot":"","sources":["../../src/vite/angled-screen-shader.tsx"],"names":[],"mappings":"AAoDA,OAAO,EAAwC,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEhG,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,0BAA0B,CAAA;AAGjC;oDACoD;AACpD,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,kBAAkB,CAAC;IACpE,QAAQ,EAAE,SAAS,CAAA;IACnB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,oDAAoD;IACpD,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAMD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BA6NpD"}
|