Spaces:
Sleeping
Sleeping
Update main.py
Browse files439 unmodified lines44044144244344444544644744844945010 unmodified lines461462463464465466467468469470471439 unmodified linessteps: int = 25cfg: int = 6seed: int = -1@app.post("/Immagine")def generate_image(request: Request, input_data: InputImage):#client = Client("https://manjushri-sdxl-1-0.hf.space/")client = Client("AP123/SDXL-Lightning")if input_data.style:print(input_data.style)if input_data.style == 'RANDOM':10 unmodified lineswhile attempt < max_attempts:try:print(input_data.input)result = client.predict(input_data.input,"8-Step",api_name="/generate_image")image_url = resultprint(image_url)with open(image_url, 'rb') as img_file:439 unmodified lines44044144244344444544644744844945045110 unmodified lines462463464465466467468469470471472473474475476477478479480481482483484485486487439 unmodified linessteps: int = 25cfg: int = 6seed: int = -1variante = False@app.post("/Immagine")def generate_image(request: Request, input_data: InputImage):#client = Client("https://manjushri-sdxl-1-0.hf.space/")if input_data.style:print(input_data.style)if input_data.style == 'RANDOM':10 unmodified lineswhile attempt < max_attempts:try:print(input_data.input)if input_data.variante = False:client = Client("AP123/SDXL-Lightning")result = client.predict(input_data.input,"8-Step",api_name="/generate_image")else:client = Client("https://playgroundai-playground-v2-5.hf.space/--replicas/9kuov/")result = client.predict(input_data.input, # str in 'Prompt' Textbox componentinput_data.negativePrompt, # str in 'Negative prompt' Textbox componentTrue, # bool in 'Use negative prompt' Checkbox component0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component1024, # float (numeric value between 256 and 1536) in 'Width' Slider component1024, # float (numeric value between 256 and 1536) in 'Height' Slider component3, # float (numeric value between 0.1 and 20) in 'Guidance Scale' Slider componentTrue, # bool in 'Randomize seed' Checkbox componentapi_name="/run")image_url = resultprint(image_url)with open(image_url, 'rb') as img_file:
main.py+22-6