MCPcopy
hub / github.com/lllyasviel/FramePack / process

Function process

demo_gradio.py:318–343  ·  view source on GitHub ↗
(input_image, prompt, n_prompt, seed, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, use_teacache, mp4_crf)

Source from the content-addressed store, hash-verified

316
317
318def process(input_image, prompt, n_prompt, seed, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, use_teacache, mp4_crf):
319 global stream
320 assert input_image is not None, 'No input image!'
321
322 yield None, None, '', '', gr.update(interactive=False), gr.update(interactive=True)
323
324 stream = AsyncStream()
325
326 async_run(worker, input_image, prompt, n_prompt, seed, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, use_teacache, mp4_crf)
327
328 output_filename = None
329
330 while True:
331 flag, data = stream.output_queue.next()
332
333 if flag == 'file':
334 output_filename = data
335 yield output_filename, gr.update(), gr.update(), gr.update(), gr.update(interactive=False), gr.update(interactive=True)
336
337 if flag == 'progress':
338 preview, desc, html = data
339 yield gr.update(), gr.update(visible=True, value=preview), desc, html, gr.update(interactive=False), gr.update(interactive=True)
340
341 if flag == 'end':
342 yield output_filename, gr.update(visible=False), gr.update(), '', gr.update(interactive=True), gr.update(interactive=False)
343 break
344
345
346def end_process():

Callers

nothing calls this directly

Calls 3

AsyncStreamClass · 0.90
async_runFunction · 0.90
nextMethod · 0.80

Tested by

no test coverage detected