Spaces:
Sleeping
Sleeping
Update main.py
Browse files172 unmodified lines17317417517617717817912 unmodified lines192193194195196197198199200201202203204205172 unmodified lines@app.post("/Immagine")def generate_image(request: Request, input_data: InputImage):client = Client("https://openskyml-fast-sdxl-stable-diffusion-xl.hf.space/--replicas/545b5tw7n/")if input_data.style:print(input_data.style)12 unmodified lineswhile attempt < max_attempts:try:result = client.predict(input_data.input,input_data.negativePrompt,input_data.steps,input_data.cfg,1024,1024,input_data.seed,fn_index=0)image_url = resultwith open(image_url, 'rb') as img_file:172 unmodified lines17317417517617717817912 unmodified lines192193194195196197198199200201202203204205206207208209210211212213172 unmodified lines@app.post("/Immagine")def generate_image(request: Request, input_data: InputImage):client = Client("https://hysts-sd-xl.hf.space/--replicas/cplz0/")if input_data.style:print(input_data.style)12 unmodified lineswhile attempt < max_attempts:try:result = client.predict(input_data.input, # str in 'Prompt' Textbox componentinput_data.negativePrompt, # str in 'Negative prompt' Textbox componentinput_data.input, # str in 'Prompt 2' Textbox componentinput_data.negativePrompt, # str in 'Negative prompt 2' Textbox componentTrue, # bool in 'Use negative prompt' Checkbox componentTrue, # bool in 'Use prompt 2' Checkbox componentTrue, # bool in 'Use negative prompt 2' Checkbox componentinput_data.seed, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component1024, # float (numeric value between 256 and 1024) in 'Width' Slider component1024, # float (numeric value between 256 and 1024) in 'Height' Slider componentinput_data.cfg, # float (numeric value between 1 and 20) in 'Guidance scale for base' Slider componentinput_data.cfg, # float (numeric value between 1 and 20) in 'Guidance scale for refiner' Slider componentinput_data.steps, # float (numeric value between 10 and 100) in 'Number of inference steps for base' Slider componentinput_data.steps, # float (numeric value between 10 and 100) in 'Number of inference steps for refiner' Slider componentTrue, # bool in 'Apply refiner' Checkbox componentapi_name="/run")image_url = resultwith open(image_url, 'rb') as img_file:
main.py+17-9