diff --git a/assets/js/ui.js b/assets/js/ui.js new file mode 100644 index 0000000..f67050c --- /dev/null +++ b/assets/js/ui.js @@ -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"; + } +}