mirror of
https://github.com/vibegif/vibegif.lol.git
synced 2026-04-07 10:12:13 +00:00
Feat: UI helpers and prompt builders
This commit is contained in:
18
assets/js/ui.js
Normal file
18
assets/js/ui.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
export const FIRST_PROMPT_TEMPLATE = "minimal black and white line doodle, single stroke, white background, kawaii style, {userPrompt}";
|
||||||
|
|
||||||
|
export function firstPrompt(userPrompt) {
|
||||||
|
return FIRST_PROMPT_TEMPLATE.replace("{userPrompt}", userPrompt);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function nextFramePrompt(frameCount) {
|
||||||
|
return `imagine we are trying to create a ${frameCount} frame gif. generate the next meaningful frame`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function clampForm(form) {
|
||||||
|
form.frameCount = Math.min(24, Math.max(2, Number(form.frameCount || 4)));
|
||||||
|
form.fps = Math.min(24, Math.max(1, Number(form.fps || 6)));
|
||||||
|
|
||||||
|
if (form.model !== "google/gemini-3.1-flash-image-preview" && form.imageSize === "0.5K") {
|
||||||
|
form.imageSize = "1K";
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user