Spaces:
Build error
Build error
Update main.py
Browse files439 unmodified lines44044144244344444544644744744844945045110 unmodified lines462463464465466464465466467468467468469470471472473474475476477478479480481482483484485486487439 unmodified lines steps: int = 25 cfg: int = 6 seed: int = -1 variante = False
@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 lines while 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" ) 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 component input_data.negativePrompt, # str in 'Negative prompt' Textbox component True, # bool in 'Use negative prompt' Checkbox component 0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component 1024, # float (numeric value between 256 and 1536) in 'Width' Slider component 1024, # float (numeric value between 256 and 1536) in 'Height' Slider component 3, # float (numeric value between 0.1 and 20) in 'Guidance Scale' Slider component True, # bool in 'Randomize seed' Checkbox component api_name="/run" ) image_url = result print(image_url) with open(image_url, 'rb') as img_file:main.py+22-6