Spaces:
Sleeping
Sleeping
fix(spaces): allow variable positional arguments in estimate_duration and generate
Browse files90 unmodified lines919293949596979899100101755 unmodified lines85785885986086186290 unmodified linesMAX_SEED = 2**31 - 1def estimate_duration(prompt, mode="Text to Image", ref_image_1=None, ref_image_2=None,lora_adapter=DEFAULT_LORA, lora_strength=1.0,custom_repo="", custom_file="", aspect_ratio=AUTO,steps=6, seed=42, randomize_seed=True,custom_width=1024, custom_height=1024, **kwargs):"""Estimate needed GPU runtime (in seconds) to avoid over-reserving ZeroGPU quota."""base_time = 15.0step_val = safe_int(steps, fallback=6, min_val=1, max_val=40)755 unmodified linescustom_width: int = 1024,custom_height: int = 1024,progress: gr.Progress = gr.Progress(track_tqdm=True),) -> tuple[Image.Image, str, str, str, str]:prompt = (prompt or "").strip()lora_strength = safe_float(lora_strength, fallback=1.0, min_val=0.0, max_val=1.5)90 unmodified lines919293949596979899100101755 unmodified lines85785885986086186286386490 unmodified linesMAX_SEED = 2**31 - 1def estimate_duration(prompt="", mode="Text to Image", ref_image_1=None, ref_image_2=None,lora_adapter=DEFAULT_LORA, lora_strength=1.0,custom_repo="", custom_file="", aspect_ratio=AUTO,steps=6, seed=42, randomize_seed=True,custom_width=1024, custom_height=1024, *args, **kwargs):"""Estimate needed GPU runtime (in seconds) to avoid over-reserving ZeroGPU quota."""base_time = 15.0step_val = safe_int(steps, fallback=6, min_val=1, max_val=40)755 unmodified linescustom_width: int = 1024,custom_height: int = 1024,progress: gr.Progress = gr.Progress(track_tqdm=True),*args,**kwargs,) -> tuple[Image.Image, str, str, str, str]:prompt = (prompt or "").strip()lora_strength = safe_float(lora_strength, fallback=1.0, min_val=0.0, max_val=1.5)
app.py+4-2