fffiloni commited on
Commit
84e90ff
·
verified ·
1 Parent(s): 4aa15cc

Place Hugging Face sign-in before the studio monitor

Browse files
Files changed (5) hide show
  1. README.md +2 -2
  2. app.py +4 -3
  3. assets/credits.html +1 -1
  4. assets/studio.css +5 -12
  5. assets/studio.js +2 -10
README.md CHANGED
@@ -27,13 +27,13 @@ models:
27
 
28
  # FastFrames Voice
29
 
30
- A private research prototype for directing a continuous generated shot with spoken or written cues. Version 0.5.2. The monitor fills the studio above a horizontal desk for the microphone, transcript and interpreted direction. Open Sessions in the header to browse recordings.
31
 
32
  Select Voice and start the microphone, or select Text, write a direction and press Generate segment (Enter to send, Shift+Enter for a new line). Text mode releases the microphone. Switching inputs preserves the shot. Each accepted direction generates one silent segment at 832 × 480 and 16 fps. Choose 1–8 whole seconds (default 4) before submitting each direction. Each second contains 16 frames. The opening generates one extra latent and trims one leading decoded frame after the model’s three startup frames to deliver an exact whole-second clip. The last generated image stays in the monitor while you think or while the next cue is being interpreted. End session joins completed segments into a downloadable MP4. Microphone mute discards unsubmitted audio and stops capture. Unmute continues the same take. The monitor plays the generated frames on an inline canvas, including on iPhone. The browser decodes the next JPEG strip during playback and displays the frames on one 16 fps timeline. The complete take uses a native MP4 player with inline playback and download.
33
 
34
  After a clip is complete, voice and text directions can continue the shot or redo its last segment. Check **Redo last segment** to force a variant for one instruction. A redo uses the duration and the starting state of the original (the same initial seed for the opening). The next-segment duration selector is preserved. With an ambiguous cue, answer “last segment” or “next segment” by voice, text or button; the studio keeps the original direction while waiting. Review both versions, then choose **Keep original** or **Use variant**. Ending during review exports the original. Only chosen clips enter the recording and future continuity.
35
 
36
- Fluid Speech Pro transcribes voice on CPU. Typed directions bypass speech recognition. Inkling 2 Mini updates the last completed shot via Hugging Face Inference Providers when a provider credential is available. Only the text of the current direction, previous direction, target and visual prompt are sent to the HF router. Sign in through Account in the studio footer before starting a take to use your inference credits, or set a server-side HF_INFERENCE_TOKEN secret scoped to Inference Providers. Qwen runs locally when no credential is present or the provider call fails. The interpreted direction identifies the model used. FastFrames-S receives one ZeroGPU allocation per segment, with a 60-second maximum runtime for computation and checkpoint I/O. Between directions, the session keeps its exact occupied attention cache, decoder history, frame indices and random generator state on the Space's temporary filesystem. The latest clip and its immediate predecessor retain their checkpoints. A pending variant has its own temporary checkpoint until the user chooses a version. Ending a studio session saves the recording, chosen clips, original seed, text conditioning and the last two continuity checkpoints to a private attached HF bucket. The Sessions view lists finalized recordings, plays/downloads the MP4, and restores a local working copy for continuing or redoing the last clip. Each finished continuation is a new saved session. The original stays available. Unsubmitted variants and microphone audio are excluded. Closing a tab before a save completes may lose the unsaved work.
37
 
38
  Anonymous sessions belong to a private browser key in local storage. Clearing site data or using a different browser loses that key. When signed in through the in-app HF button, new sessions belong to the HF account and can be reopened on another device. The Space operator controls the private backing bucket. Earlier prototype exports without stored checkpoints cannot be restored.
39
 
 
27
 
28
  # FastFrames Voice
29
 
30
+ A private research prototype for directing a continuous generated shot with spoken or written cues. Version 0.5.3. The monitor fills the studio above a horizontal desk for the microphone, transcript and interpreted direction. Open Sessions in the header to browse recordings.
31
 
32
  Select Voice and start the microphone, or select Text, write a direction and press Generate segment (Enter to send, Shift+Enter for a new line). Text mode releases the microphone. Switching inputs preserves the shot. Each accepted direction generates one silent segment at 832 × 480 and 16 fps. Choose 1–8 whole seconds (default 4) before submitting each direction. Each second contains 16 frames. The opening generates one extra latent and trims one leading decoded frame after the model’s three startup frames to deliver an exact whole-second clip. The last generated image stays in the monitor while you think or while the next cue is being interpreted. End session joins completed segments into a downloadable MP4. Microphone mute discards unsubmitted audio and stops capture. Unmute continues the same take. The monitor plays the generated frames on an inline canvas, including on iPhone. The browser decodes the next JPEG strip during playback and displays the frames on one 16 fps timeline. The complete take uses a native MP4 player with inline playback and download.
33
 
34
  After a clip is complete, voice and text directions can continue the shot or redo its last segment. Check **Redo last segment** to force a variant for one instruction. A redo uses the duration and the starting state of the original (the same initial seed for the opening). The next-segment duration selector is preserved. With an ambiguous cue, answer “last segment” or “next segment” by voice, text or button; the studio keeps the original direction while waiting. Review both versions, then choose **Keep original** or **Use variant**. Ending during review exports the original. Only chosen clips enter the recording and future continuity.
35
 
36
+ Fluid Speech Pro transcribes voice on CPU. Typed directions bypass speech recognition. Inkling 2 Mini updates the last completed shot via Hugging Face Inference Providers when a provider credential is available. Only the text of the current direction, previous direction, target and visual prompt are sent to the HF router. Use the Hugging Face sign-in button below the studio title before starting a take to use your inference credits, or set a server-side HF_INFERENCE_TOKEN secret scoped to Inference Providers. Qwen runs locally when no credential is present or the provider call fails. The interpreted direction identifies the model used. FastFrames-S receives one ZeroGPU allocation per segment, with a 60-second maximum runtime for computation and checkpoint I/O. Between directions, the session keeps its exact occupied attention cache, decoder history, frame indices and random generator state on the Space's temporary filesystem. The latest clip and its immediate predecessor retain their checkpoints. A pending variant has its own temporary checkpoint until the user chooses a version. Ending a studio session saves the recording, chosen clips, original seed, text conditioning and the last two continuity checkpoints to a private attached HF bucket. The Sessions view lists finalized recordings, plays/downloads the MP4, and restores a local working copy for continuing or redoing the last clip. Each finished continuation is a new saved session. The original stays available. Unsubmitted variants and microphone audio are excluded. Closing a tab before a save completes may lose the unsaved work.
37
 
38
  Anonymous sessions belong to a private browser key in local storage. Clearing site data or using a different browser loses that key. When signed in through the in-app HF button, new sessions belong to the HF account and can be reopened on another device. The Space operator controls the private backing bucket. Earlier prototype exports without stored checkpoints cannot be restored.
39
 
app.py CHANGED
@@ -272,6 +272,10 @@ BUS_JS="watch('value', () => { if (props.value) window.dispatchEvent(new CustomE
272
  with gr.Blocks(title="FastFrames Voice",fill_width=True,delete_cache=(600,1800)) as demo:
273
  with gr.Column(elem_id="studio"):
274
  gr.HTML(asset("header.html"),apply_default_css=False,padding=False,container=False,elem_id="studio-header")
 
 
 
 
275
  with gr.Column(elem_id="work-area"):
276
  with gr.Column(elem_id="monitor"):
277
  gr.HTML(asset("monitor.html"),apply_default_css=False,padding=False,container=False,elem_id="cover")
@@ -285,9 +289,6 @@ with gr.Blocks(title="FastFrames Voice",fill_width=True,delete_cache=(600,1800))
285
  gr.HTML(asset("gallery.html"),container=False,padding=False,apply_default_css=False,elem_id="gallery-panel")
286
  gallery_video=gr.Video(label="Saved session",interactive=False,buttons=["download"],elem_id="gallery-video")
287
  gr.HTML(asset("credits.html"),apply_default_css=False,padding=False,container=False,elem_id="studio-credits")
288
- with gr.Row(elem_id="provider-account"):
289
- gr.HTML('<span class="label" data-tr="providerHelp">Sign in for sessions across devices and Inkling direction.</span>', container=False)
290
- gr.LoginButton(elem_id="provider-login", size="sm", variant="secondary")
291
  def bus(name):
292
  return gr.HTML(value="",html_template="<span></span>",js_on_load=BUS_JS,elem_id=name,container=False)
293
  cpu_bus=bus("cpu-signal")
 
272
  with gr.Blocks(title="FastFrames Voice",fill_width=True,delete_cache=(600,1800)) as demo:
273
  with gr.Column(elem_id="studio"):
274
  gr.HTML(asset("header.html"),apply_default_css=False,padding=False,container=False,elem_id="studio-header")
275
+ with gr.Row(elem_id="provider-account"):
276
+ gr.LoginButton(elem_id="provider-login", size="sm", variant="secondary")
277
+ gr.HTML('<span data-tr="providerHelp">Use Inkling and access your sessions across devices.</span>',
278
+ elem_id="provider-help", container=False, padding=False, apply_default_css=False)
279
  with gr.Column(elem_id="work-area"):
280
  with gr.Column(elem_id="monitor"):
281
  gr.HTML(asset("monitor.html"),apply_default_css=False,padding=False,container=False,elem_id="cover")
 
289
  gr.HTML(asset("gallery.html"),container=False,padding=False,apply_default_css=False,elem_id="gallery-panel")
290
  gallery_video=gr.Video(label="Saved session",interactive=False,buttons=["download"],elem_id="gallery-video")
291
  gr.HTML(asset("credits.html"),apply_default_css=False,padding=False,container=False,elem_id="studio-credits")
 
 
 
292
  def bus(name):
293
  return gr.HTML(value="",html_template="<span></span>",js_on_load=BUS_JS,elem_id=name,container=False)
294
  cpu_bus=bus("cpu-signal")
assets/credits.html CHANGED
@@ -1 +1 @@
1
- <footer class="credit-line"><div><button type="button" id="account-toggle" data-tr="accountLink" aria-expanded="false" aria-controls="provider-account">Account</button><a href="https://huggingface.co/apple/FastFrames-S" target="_blank" rel="noopener">FastFrames-S <span>· Apple</span></a><a href="https://huggingface.co/FluidVoice-Labs/fluid-speech-pro" target="_blank" rel="noopener">Fluid Speech Pro <span>· FluidVoice</span></a><a href="https://huggingface.co/thinkingmachines/Inkling-2-Mini" target="_blank" rel="noopener">Inkling 2 Mini <span>· Thinking Machines</span></a><a href="https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507" target="_blank" rel="noopener">Qwen</a><a href="https://huggingface.co/spaces/linoyts/fastframes-s-live" target="_blank" rel="noopener"><span data-tr="source">Source Space</span> · linoyts</a></div><a href="https://huggingface.co/fffiloni" target="_blank" rel="noopener">UI/UX · Sylvain Filoni / fffiloni</a></footer>
 
1
+ <footer class="credit-line"><div><a href="https://huggingface.co/apple/FastFrames-S" target="_blank" rel="noopener">FastFrames-S <span>· Apple</span></a><a href="https://huggingface.co/FluidVoice-Labs/fluid-speech-pro" target="_blank" rel="noopener">Fluid Speech Pro <span>· FluidVoice</span></a><a href="https://huggingface.co/thinkingmachines/Inkling-2-Mini" target="_blank" rel="noopener">Inkling 2 Mini <span>· Thinking Machines</span></a><a href="https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507" target="_blank" rel="noopener">Qwen</a><a href="https://huggingface.co/spaces/linoyts/fastframes-s-live" target="_blank" rel="noopener"><span data-tr="source">Source Space</span> · linoyts</a></div><a href="https://huggingface.co/fffiloni" target="_blank" rel="noopener">UI/UX · Sylvain Filoni / fffiloni</a></footer>
assets/studio.css CHANGED
@@ -78,10 +78,7 @@
78
  #voice-desk[data-input=text] .console{grid-template-columns:1fr 1.1fr}
79
  #voice-desk[data-input=text] .readout:nth-child(2){border-left:0}
80
  #interpreter{color:#b4beb7;font-size:12px}
81
- #provider-account{align-items:center;justify-content:flex-end;gap:8px;margin:0 0 8px}
82
- #provider-account>div{min-width:0!important;flex:auto}#studio #provider-login{flex:0 1 auto;min-width:0;min-height:38px;font-size:13px}
83
- #studio:has(#voice-desk[data-active=true]) #provider-account{display:none}
84
- @media(max-width:540px){.duration{gap:5px}.composer{flex-direction:column}.composer button{align-self:flex-end}.composer textarea{font-size:16px!important;width:100%}.cue-tools{margin-top:8px}.credit-line{line-height:1.4}#provider-account{flex-wrap:wrap}}
85
  /* The standalone HF page inserts its own fixed, 42 px account bar at top:12px. */
86
  body:has(#huggingface-space-header) #studio{margin-top:54px}
87
  html:has(#huggingface-space-header){scroll-padding-top:60px}
@@ -119,7 +116,6 @@ html:has(#huggingface-space-header){scroll-padding-top:60px}
119
  #studio .desk-rail select{min-height:40px}
120
  #voice-desk[data-has-clip=false] #redo-control{display:none}
121
  #voice-desk[data-review=true] .cue-tools,#voice-desk[data-review=true] #text-control{display:none!important}
122
- #studio #provider-account{margin:8px 0 6px;padding:0}
123
  .collection-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
124
  #studio .collection-heading h2{font:600 23px/1.15 Barlow,Arial,sans-serif;margin:0;color:#f3f2e9}
125
  #collection,#gallery-signal{display:none!important}
@@ -155,13 +151,10 @@ html:has(#huggingface-space-header){scroll-padding-top:60px}
155
  #voice-desk .control-cell{padding:9px 12px}
156
  #voice-desk .readout p{font-size:15px}
157
  }
158
- #studio #provider-account .label,#studio #provider-account [data-tr=providerHelp]{color:#bfcbc1!important}
159
- #studio #provider-account{display:none!important}
160
- #studio .credit-line #account-toggle{min-height:32px;background:transparent;border:0;padding:0;color:inherit;text-decoration:underline;text-underline-offset:3px}
161
- #studio:has(#voice-desk[data-active=true]) #account-toggle{display:none}
162
- #studio[data-account-open=true]:not(:has(#voice-desk[data-active=true])) #provider-account{display:flex!important;flex-flow:row wrap!important;align-items:center;gap:8px 16px}
163
- #studio #provider-account>div{width:auto!important;min-width:0;max-width:100%}
164
- #studio #provider-login{background:#222a25!important;color:#f2f2eb!important;border:1px solid #59665c;border-radius:5px;min-height:44px;padding:0 12px}
165
  #studio .langs button{min-width:32px;min-height:44px}
166
  #gallery-panel{padding:0!important;border:0!important;background:transparent!important;--block-padding:0}
167
  @media(max-width:580px){
 
78
  #voice-desk[data-input=text] .console{grid-template-columns:1fr 1.1fr}
79
  #voice-desk[data-input=text] .readout:nth-child(2){border-left:0}
80
  #interpreter{color:#b4beb7;font-size:12px}
81
+ @media(max-width:540px){.duration{gap:5px}.composer{flex-direction:column}.composer button{align-self:flex-end}.composer textarea{font-size:16px!important;width:100%}.cue-tools{margin-top:8px}.credit-line{line-height:1.4}}
 
 
 
82
  /* The standalone HF page inserts its own fixed, 42 px account bar at top:12px. */
83
  body:has(#huggingface-space-header) #studio{margin-top:54px}
84
  html:has(#huggingface-space-header){scroll-padding-top:60px}
 
116
  #studio .desk-rail select{min-height:40px}
117
  #voice-desk[data-has-clip=false] #redo-control{display:none}
118
  #voice-desk[data-review=true] .cue-tools,#voice-desk[data-review=true] #text-control{display:none!important}
 
119
  .collection-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
120
  #studio .collection-heading h2{font:600 23px/1.15 Barlow,Arial,sans-serif;margin:0;color:#f3f2e9}
121
  #collection,#gallery-signal{display:none!important}
 
151
  #voice-desk .control-cell{padding:9px 12px}
152
  #voice-desk .readout p{font-size:15px}
153
  }
154
+ #studio #provider-account{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;margin:0 0 12px}
155
+ #studio:has(#voice-desk[data-active=true]) #provider-account{display:none}
156
+ #studio #provider-help{min-width:0;padding:0;color:#b5bdb9;font:400 14px/1.3 Barlow,Arial,sans-serif}
157
+ #studio #provider-login{min-width:0;justify-self:start;background:#222a25!important;color:#f2f2eb!important;border:1px solid #59665c;border-radius:5px;min-height:44px;padding:0 12px}
 
 
 
158
  #studio .langs button{min-width:32px;min-height:44px}
159
  #gallery-panel{padding:0!important;border:0!important;background:transparent!important;--block-padding:0}
160
  @media(max-width:580px){
assets/studio.js CHANGED
@@ -30,12 +30,12 @@ const copy = {
30
  review:["Compare the two versions","Compare les deux versions"],deciding:["Saving your choice…","Enregistrement de ton choix…"],
31
  decision_error:["Couldn’t save your choice · try again","Choix non enregistré · réessaie"],
32
  invalid_target:["Pick the latest completed segment","Choisis le dernier segment terminé"],invalid_operation:["Invalid action","Action invalide"],
33
- accountLink:["Account","Compte"],endSave:["End session and save recording","Terminer la session et enregistrer la vidéo"],
34
  end:["End session","Terminer"],intro:["Describe your opening shot.","Décris ton premier plan."],
35
  preview:["Preview frame","Aperçu"],help:["Speak or type a direction to begin.","Utilise la voix ou le clavier pour commencer."],
36
  voiceMode:["Voice","Voix"],textMode:["Text","Texte"],duration:["Next segment","Prochaine portion"],
37
  textLabel:["Written direction","Consigne écrite"],textIdle:["Ready for a written direction","En attente d’une consigne écrite"],
38
- providerHelp:["Sign in for sessions across devices and Inkling direction.","Connecte-toi pour retrouver tes sessions sur d’autres appareils et utiliser Inkling."],
39
  send:["Generate segment","Générer la portion"],starting:["Opening session…","Ouverture de la session…"],
40
  invalid_seconds:["Choose a duration from 1 to 8 s","Choisis une durée de 1 à 8 s"],
41
  invalid_text:["Enter a direction of up to 1,200 characters","Écris une consigne de 1 200 caractères maximum"],
@@ -257,14 +257,6 @@ mic.addEventListener("click",()=>{
257
  }
258
  });
259
  end.addEventListener("click",endSession);
260
- // Gradio mounts the footer independently of the desk.
261
- window.addEventListener("click",event=>{
262
- const button=event.composedPath().find(node=>node?.id==="account-toggle");
263
- if(!button)return;
264
- const studio=by("studio"), open=studio.dataset.accountOpen!=="true";
265
- studio.dataset.accountOpen=String(open);
266
- button.setAttribute("aria-expanded",String(open));
267
- });
268
  langButtons.forEach((b,i)=>b.addEventListener("click",()=>{lang=i?"fr":"en";try{localStorage.setItem("ffv-lang",lang);}catch{}label();collection?.drawItems();}));
269
  function displayClip(clip){
270
  lastSegment=clip;pendingStill=clip.still;
 
30
  review:["Compare the two versions","Compare les deux versions"],deciding:["Saving your choice…","Enregistrement de ton choix…"],
31
  decision_error:["Couldn’t save your choice · try again","Choix non enregistré · réessaie"],
32
  invalid_target:["Pick the latest completed segment","Choisis le dernier segment terminé"],invalid_operation:["Invalid action","Action invalide"],
33
+ endSave:["End session and save recording","Terminer la session et enregistrer la vidéo"],
34
  end:["End session","Terminer"],intro:["Describe your opening shot.","Décris ton premier plan."],
35
  preview:["Preview frame","Aperçu"],help:["Speak or type a direction to begin.","Utilise la voix ou le clavier pour commencer."],
36
  voiceMode:["Voice","Voix"],textMode:["Text","Texte"],duration:["Next segment","Prochaine portion"],
37
  textLabel:["Written direction","Consigne écrite"],textIdle:["Ready for a written direction","En attente d’une consigne écrite"],
38
+ providerHelp:["Use Inkling and access your sessions across devices.","Utilise Inkling et retrouve tes sessions sur tes autres appareils."],
39
  send:["Generate segment","Générer la portion"],starting:["Opening session…","Ouverture de la session…"],
40
  invalid_seconds:["Choose a duration from 1 to 8 s","Choisis une durée de 1 à 8 s"],
41
  invalid_text:["Enter a direction of up to 1,200 characters","Écris une consigne de 1 200 caractères maximum"],
 
257
  }
258
  });
259
  end.addEventListener("click",endSession);
 
 
 
 
 
 
 
 
260
  langButtons.forEach((b,i)=>b.addEventListener("click",()=>{lang=i?"fr":"en";try{localStorage.setItem("ffv-lang",lang);}catch{}label();collection?.drawItems();}));
261
  function displayClip(clip){
262
  lastSegment=clip;pendingStill=clip.still;