(input_image, prompt, n_prompt, seed, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, use_teacache, mp4_crf)
| 316 | |
| 317 | |
| 318 | def 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 | |
| 346 | def end_process(): |
nothing calls this directly
no test coverage detected