Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files104 unmodified lines105106107108109110111112113114115116400 unmodified lines51751851952052152252331 unmodified lines55555655755155855956056161 unmodified lines62362462562662762862955 unmodified lines685686687688689690691120 unmodified lines812813814815816817818819820821822823128 unmodified lines952953954955956957958104 unmodified lines# 15.083 s, and is refused.MIN_UI_DURATION, MAX_UI_DURATION = 2, 14
SAMPLERS = { "euler": "euler", "euler ancestral": "euler_ancestral",}DEFAULT_SAMPLER = "euler"
SCHEDULES = { "linear_quadratic · PlagueKind": "linear_quadratic", "sgm_uniform": "sgm_uniform",400 unmodified lines maximize_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 lines requested_steps = steps if custom_schedule else steps + 1
started = time.time() with pk.use_schedule(PIPE, steps, schedule, video_shift, audio_shift): 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 lines maximize_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 lines bool(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 lines value=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 lines maximize_gpu, video_shift, audio_shift, sampler, ]
run.click(generate, controls, [video, report], api_name="generate")app.py+17-1