Spaces:
Sleeping
Sleeping
Update main.py
Browse files185 unmodified lines18618718818919019119219319419519619719819920020120220320420520620720820921023 unmodified lines234235236237185 unmodified linesstyle_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 = 20attempt = 0while 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 component1024, # int | float (numeric value between 512 and 1024) in 'Height' Slider component1024, # int | float (numeric value between 512 and 1024) in 'Width' Slider component7, # int | float (numeric value between 1 and 15) in 'Guidance Scale: How Closely the AI follows the Prompt' Slider component30, # int | float (numeric value between 25 and 100) in 'Number of Iterations' Slider component0, # 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 component0.7, # int | float (numeric value between 0.7 and 0.99) in 'Refiner Denoise Start %' Slider component1, # int | float (numeric value between 1 and 100) in 'Refiner Number of Iterations %' Slider componentapi_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"}185 unmodified lines18618718818919019119219319419519619719819920020120220320420520620720820923 unmodified lines233234235236185 unmodified linesstyle_info = style_image[input_data.style]input_data.input = style_info["descrizione"].format(prompt=input_data.input)input_data.negativePrompt = style_info["negativePrompt"]max_attempts = 2attempt = 0while attempt < max_attempts:try:result = client.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 componentinput_data.negativePrompt, # str in 'What you Do Not want the AI to generate. 77 Token Limit' Textbox component1024, # int | float (numeric value between 512 and 1024) in 'Height' Slider component1024, # int | float (numeric value between 512 and 1024) in 'Width' Slider componentinput_data.cfg, # int | float (numeric value between 1 and 15) in 'Guidance Scale: How Closely the AI follows the Prompt' Slider componentinput_data.steps, # int | float (numeric value between 25 and 100) in 'Number of Iterations' Slider component0, # 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 component0.99, # int | float (numeric value between 0.7 and 0.99) in 'Refiner Denoise Start %' Slider component100, # int | float (numeric value between 1 and 100) in 'Refiner Number of Iterations %' Slider componentapi_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"}
main.py+15-16