Spaces:
Runtime error
Runtime error
Commit ·
640072b
1
Parent(s): 9c8b547
Refactor GPU decorator and update FramePack description in app.py
Browse files64 unmodified lines65666768686970200 unmodified lines27127227327527427527627736 unmodified lines31431531631831731831932032132232332432532632732832933033133233333433532 unmodified lines36836937035737164 unmodified linesoutputs_folder = './outputs/'os.makedirs(outputs_folder, exist_ok=True)
@torch.no_grad()def worker(input_image, prompt, n_prompt, seed, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, use_teacache): total_latent_sections = (total_second_length * 30) / (latent_window_size * 4)200 unmodified lines stream.output_queue.push(('end', None)) return
@spaces.GPU()@spaces.GPU(duration=120)def process(input_image, prompt, n_prompt, seed, total_second_length, latent_window_size, steps, cfg, gs, rs, gpu_memory_preservation, use_teacache): global stream assert input_image is not None, 'No input image!'36 unmodified linescss = make_progress_bar_css()block = gr.Blocks(css=css).queue()with block: gr.Markdown('# FramePack') gr.Markdown(''' # [FramePack](https://github.com/lllyasviel/FramePack) ## Image to Video Animation Tool FramePack transforms still images into smooth, natural-looking animations using AI. Upload a portrait or character image and describe the motion you want to see. ### How to use: 1. **Upload an image** - Best results with clear, well-lit portraits 2. **Enter a prompt** describing the movement (or select from quick examples) 3. **Click "Start Generation"** and wait for the video to be created Generation takes a few minutes. The video is created in reverse order, so the beginning of the animation will appear last. *For high-quality results, use simple and clear descriptions of movements.* ''') with gr.Row(): with gr.Column(): input_image = gr.Image(sources='upload', type="numpy", label="Image", height=320)32 unmodified lines end_button.click(fn=end_process)
block.queue().launch(share=True)block.launch(share=True)app.py+18-4