Spaces:
Sleeping
Sleeping
Update app.py
Browse files104 unmodified lines105106107108109110400 unmodified lines51151251351451551631 unmodified lines54854955055155255355461 unmodified lines61661761861962062155 unmodified lines677678679680681682120 unmodified lines803804805806807808128 unmodified lines937938939940941942104 unmodified lines# 15.083 s, and is refused.MIN_UI_DURATION, MAX_UI_DURATION = 2, 14SCHEDULES = {"linear_quadratic · PlagueKind": "linear_quadratic","sgm_uniform": "sgm_uniform",400 unmodified linesmaximize_gpu,video_shift,audio_shift,):"""The only thing on GPU time: the denoise loop, the two decoders and the workflow's post chain.The mp4 is muxed here rather than in the caller: a `@spaces.GPU` return crosses a process boundary by pickling,31 unmodified linesrequested_steps = steps if custom_schedule else steps + 1started = time.time()with pk.use_schedule(PIPE, steps, schedule, video_shift, audio_shift):state = PIPE(prompt_embeds=prompt_embeds.to("cuda"),text_token_tags=text_token_tags,61 unmodified linesmaximize_gpu=False,video_shift=DEFAULT_VIDEO_SHIFT,audio_shift=DEFAULT_AUDIO_SHIFT,progress=gr.Progress(track_tqdm=True),):"""One request through the PlagueKind graph. Every parameter but the prompt carries the default its UI55 unmodified linesbool(maximize_gpu),float(video_shift),float(audio_shift),)# The same call `spaces` will book the worker with, so the report can show the fit against the measurement.booked_seconds = get_duration(*call)120 unmodified linesvalue=DEFAULT_STEPS,info="PlagueKind: 15-20 on the linear_quadratic grid.",)schedule = gr.Dropdown(label="Sigma schedule",choices=list(SCHEDULES),128 unmodified linesmaximize_gpu,video_shift,audio_shift,]run.click(generate, controls, [video, report], api_name="generate")104 unmodified lines105106107108109110111112113114115116400 unmodified lines51751851952052152252331 unmodified lines55555655755855956056161 unmodified lines62362462562662762862955 unmodified lines685686687688689690691120 unmodified lines812813814815816817818819820821822823128 unmodified lines952953954955956957958104 unmodified lines# 15.083 s, and is refused.MIN_UI_DURATION, MAX_UI_DURATION = 2, 14SAMPLERS = {"euler": "euler","euler ancestral": "euler_ancestral",}DEFAULT_SAMPLER = "euler"SCHEDULES = {"linear_quadratic · PlagueKind": "linear_quadratic","sgm_uniform": "sgm_uniform",400 unmodified linesmaximize_gpu,video_shift,audio_shift,sampler,):"""The only thing on GPU time: the denoise loop, the two decoders and the workflow's post chain.The mp4 is muxed here rather than in the caller: a `@spaces.GPU` return crosses a process boundary by pickling,31 unmodified linesrequested_steps = steps if custom_schedule else steps + 1started = time.time()with pk.use_schedule(PIPE, steps, schedule, video_shift, audio_shift, sampler_name=sampler, seed=int(seed)):state = PIPE(prompt_embeds=prompt_embeds.to("cuda"),text_token_tags=text_token_tags,61 unmodified linesmaximize_gpu=False,video_shift=DEFAULT_VIDEO_SHIFT,audio_shift=DEFAULT_AUDIO_SHIFT,sampler=DEFAULT_SAMPLER,progress=gr.Progress(track_tqdm=True),):"""One request through the PlagueKind graph. Every parameter but the prompt carries the default its UI55 unmodified linesbool(maximize_gpu),float(video_shift),float(audio_shift),SAMPLERS.get(sampler, "euler"),)# The same call `spaces` will book the worker with, so the report can show the fit against the measurement.booked_seconds = get_duration(*call)120 unmodified linesvalue=DEFAULT_STEPS,info="PlagueKind: 15-20 on the linear_quadratic grid.",)sampler = gr.Dropdown(label="Sampler",choices=list(SAMPLERS),value=DEFAULT_SAMPLER,info="`euler ancestral` re-injects noise each step — expect seed to matter more.",)schedule = gr.Dropdown(label="Sigma schedule",choices=list(SCHEDULES),128 unmodified linesmaximize_gpu,video_shift,audio_shift,sampler,]run.click(generate, controls, [video, report], api_name="generate")
app.py+17-1