Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.
Image generation explains why an empty description does not start a picture
Bowen Xued74eea721e23
diff --git a/web/image_editor.css b/web/image_editor.cssindex 86d84be..a1084a9 100644--- a/web/image_editor.css+++ b/web/image_editor.css@@ -11,7 +11,7 @@.fv-image-editor [hidden]{display:none!important}.fv-image-editor :focus-visible{outline:2px solid var(--fv-accent);outline-offset:2px}.fv-image-editor button{font:inherit;color:var(--fv-ink);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}-.fv-image-editor button:disabled{opacity:.38;cursor:default}+.fv-image-editor button:disabled,.fv-image-editor button[aria-disabled=true]{opacity:.38;cursor:default}.fv-image-editor input,.fv-image-editor select,.fv-image-editor textarea{font:inherit;color:var(--fv-ink)}/* Header: name and size, zoom in the middle, history and leave on the right. */@@ -29,9 +29,9 @@ button.fv-ie-size:hover{background:var(--fv-hover);color:var(--fv-ink)}.fv-ie-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.fv-ie-button{min-height:var(--fv-h-sm);padding:5px 12px;border:1px solid var(--fv-border);border-radius:var(--fv-r-sm);background:var(--fv-raised);font-weight:var(--fv-medium);white-space:nowrap}-.fv-ie-button:hover:not(:disabled){background:var(--fv-hover)}+.fv-ie-button:hover:not(:disabled):not([aria-disabled=true]){background:var(--fv-hover)}.fv-ie-primary{background:var(--fv-accent);border-color:var(--fv-accent);color:#08131f;min-width:84px}-.fv-ie-primary:hover:not(:disabled){background:var(--fv-accent-hover)}+.fv-ie-primary:hover:not(:disabled):not([aria-disabled=true]){background:var(--fv-accent-hover)}.fv-ie-danger{color:var(--fv-danger);border-color:color-mix(in srgb,var(--fv-danger) 60%,transparent)}.fv-ie-quiet{background:transparent}.fv-ie-active{background:var(--fv-selected)!important;border-color:var(--fv-accent)!important;color:var(--fv-accent)!important}diff --git a/web/image_generation.js b/web/image_generation.jsindex 52f7aa2..15b9143 100644--- a/web/image_generation.js+++ b/web/image_generation.js@@ -279,6 +279,7 @@ export function createImageGenSession({client, prepare, apply, onChange = () =>export function createImageGeneration({client, renderer, t, getDoc, getSelection, commit, el, button, segmented,library = [], resolve = file => file, icon = () => '', onRatioChange}) {let mode = 'edit', prompt = '', mounted = null, references = [];+ let promptRequired = false, attentionTimer = null;const copies = new Map();// A reference is sent no larger than the largest picture the service makes.async function referencePNG(file) {@@ -304,7 +305,27 @@ export function createImageGeneration({client, renderer, t, getDoc, getSelection});const limit = () => referenceLimit(session.state().info);const chosen = () => mode === 'edit' ? references.slice(0, limit() - 1) : [];- const start = () => session.start({mode, prompt, references: chosen()});+ function clearAttention() {+ clearTimeout(attentionTimer); attentionTimer = null;+ mounted?.input.classList.remove('fv-ie-active');+ }+ function start() {+ // The button is only marked unavailable, so a click while the service is being checked is turned away here.+ const now = session.state();+ if (now.checking || !now.info?.installed) return;+ if (!prompt.trim()) {+ promptRequired = true; update();+ if (mounted) {+ const {input} = mounted;+ clearAttention(); input.focus(); input.classList.add('fv-ie-active');+ attentionTimer = setTimeout(() => {+ input.classList.remove('fv-ie-active'); attentionTimer = null;+ }, 300);+ }+ return;+ }+ return session.start({mode, prompt, references: chosen()});+ }function drawEdited(canvas) {try {const doc = getDoc(), layer = generationContext(doc, null, 'edit').layer;@@ -370,12 +391,16 @@ export function createImageGeneration({client, renderer, t, getDoc, getSelectioninput.setAttribute('aria-label', input.placeholder);action.textContent = state.running ? t('Stop', '停止') : t('Generate', '生成');action.classList.toggle('fv-ie-primary', !state.running);- action.disabled = !state.running && (disabled || !prompt.trim()); action.hidden = !!missing;+ action.setAttribute('aria-disabled', String(!state.running && (disabled || !prompt.trim())));+ action.title = !state.running && !prompt.trim() ? t('Write a short description first', '请先写一句画面描述') : '';+ action.hidden = !!missing;const percent = Math.floor(state.fraction * 100) + '%';- note.textContent = missing ? imagePackUnavailableMessage(state.info, t) : state.error ? imageGenError(state.error, state.info, t)+ note.textContent = missing ? imagePackUnavailableMessage(state.info, t)+ : promptRequired ? t('Write a short description first.', '请先写一句画面描述。')+ : state.error ? imageGenError(state.error, state.info, t): state.running ? (state.stage === 'load' ? t('Loading the model', '加载模型') + ' ' : '') + percent : '';note.hidden = !note.textContent;- bar.dataset.running = String(state.running); bar.dataset.message = String(!!missing || !!state.error);+ bar.dataset.running = String(state.running); bar.dataset.message = String(!!missing || promptRequired || !!state.error);meter.hidden = !state.running; meter.setAttribute('aria-valuenow', String(Math.floor(state.fraction * 100)));fill.style.width = state.fraction * 100 + '%';}@@ -412,8 +437,15 @@ export function createImageGeneration({client, renderer, t, getDoc, getSelectionif (ratio) bar.append(ratio);bar.append(field, note, action, meter);mounted = {bar, input, action, note, meter, fill, group, refs, ratio};- const grow = () => { input.style.height = '0px'; input.style.height = Math.min(80, Math.max(32, input.scrollHeight + 2)) + 'px'; };- input.oninput = () => { prompt = input.value; session.clearError(); grow(); };+ const grow = () => {+ input.style.height = '0px';+ input.style.height = (prompt.trim() ? Math.min(80, Math.max(32, input.scrollHeight + 2)) : 32) + 'px';+ };+ input.oninput = () => {+ prompt = input.value;+ if (prompt.trim()) promptRequired = false;+ clearAttention(); session.clearError(); grow();+ };input.onkeydown = event => {if (event.key === 'Enter' && !event.shiftKey && !event.isComposing && !event.ctrlKey && !event.metaKey) {event.preventDefault(); void start();@@ -421,6 +453,7 @@ export function createImageGeneration({client, renderer, t, getDoc, getSelection};grow(); update();}- return {mount, unmount() { mounted = null; }, selected: () => session.check(), cancel: session.cancel,- dispose: session.dispose, state: session.state};+ return {mount, unmount() { clearAttention(); promptRequired = false; mounted = null; },+ selected: () => session.check(), cancel: session.cancel,+ dispose() { clearAttention(); return session.dispose(); }, state: session.state};}