Spaces:
Sleeping
Sleeping
Update main.py
Browse files185 unmodified lines18618718818919018919019119219319519619719819920020120220320420520620719419519619719819920020120220320420520620720820923 unmodified lines233234235237236185 unmodified lines style_info = style_image[input_data.style] input_data.input = style_info["descrizione"].format(prompt=input_data.input) input_data.negativePrompt = style_info["negativePrompt"] print(input_data.input) max_attempts = 20 max_attempts = 2 attempt = 0 while attempt < max_attempts: try: result = client.predict( "Smiling Dog in a unicorn", # str in 'What you want the AI to generate. 77 Token Limit. A Token is Any Word, Number, Symbol, or Punctuation. Everything Over 77 Will Be Truncated!' Textbox component "", # str in 'What you Do Not want the AI to generate. 77 Token Limit' Textbox component 1024, # int | float (numeric value between 512 and 1024) in 'Height' Slider component 1024, # int | float (numeric value between 512 and 1024) in 'Width' Slider component 7, # int | float (numeric value between 1 and 15) in 'Guidance Scale: How Closely the AI follows the Prompt' Slider component 30, # int | float (numeric value between 25 and 100) in 'Number of Iterations' Slider component 0, # int | float (numeric value between 0 and 999999999999999999) in 'Seed: 0 is Random' Slider component "Yes", # str in 'Upscale?' Radio component "", # str in 'Embedded Prompt' Textbox component "", # str in 'Embedded Negative Prompt' Textbox component 0.7, # int | float (numeric value between 0.7 and 0.99) in 'Refiner Denoise Start %' Slider component 1, # int | float (numeric value between 1 and 100) in 'Refiner Number of Iterations %' Slider component api_name="/predict" input_data.input, # str in 'What you want the AI to generate. 77 Token Limit. A Token is Any Word, Number, Symbol, or Punctuation. Everything Over 77 Will Be Truncated!' Textbox component input_data.negativePrompt, # str in 'What you Do Not want the AI to generate. 77 Token Limit' Textbox component 1024, # int | float (numeric value between 512 and 1024) in 'Height' Slider component 1024, # int | float (numeric value between 512 and 1024) in 'Width' Slider component input_data.cfg, # int | float (numeric value between 1 and 15) in 'Guidance Scale: How Closely the AI follows the Prompt' Slider component input_data.steps, # int | float (numeric value between 25 and 100) in 'Number of Iterations' Slider component 0, # int | float (numeric value between 0 and 999999999999999999) in 'Seed: 0 is Random' Slider component "Yes", # str in 'Upscale?' Radio component "", # str in 'Embedded Prompt' Textbox component "", # str in 'Embedded Negative Prompt' Textbox component 0.99, # int | float (numeric value between 0.7 and 0.99) in 'Refiner Denoise Start %' Slider component 100, # int | float (numeric value between 1 and 100) in 'Refiner Number of Iterations %' Slider component api_name="/predict" ) image_url = result[0] print(image_url)23 unmodified lines
@app.get("/")def read_general(): return {"response": "Benvenuto. Per maggiori info: https://matteoscript-fastapi.hf.space/docs"} return {"response": "Benvenuto. Per maggiori info: https://matteoscript-fastapi.hf.space/docs"} main.py+15-16