MatteoScript commited on
Commit
d1f3e61
·
verified ·
1 Parent(s): 498d80c

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +17 -9
main.py CHANGED
@@ -173,7 +173,7 @@ class InputImage(BaseModel):
173
 
174
  @app.post("/Immagine")
175
  def generate_image(request: Request, input_data: InputImage):
176
- client = Client("https://openskyml-fast-sdxl-stable-diffusion-xl.hf.space/--replicas/545b5tw7n/")
177
 
178
  if input_data.style:
179
  print(input_data.style)
@@ -192,14 +192,22 @@ def generate_image(request: Request, input_data: InputImage):
192
  while attempt < max_attempts:
193
  try:
194
  result = client.predict(
195
- input_data.input,
196
- input_data.negativePrompt,
197
- input_data.steps,
198
- input_data.cfg,
199
- 1024,
200
- 1024,
201
- input_data.seed,
202
- fn_index=0
 
 
 
 
 
 
 
 
203
  )
204
  image_url = result
205
  with open(image_url, 'rb') as img_file:
 
173
 
174
  @app.post("/Immagine")
175
  def generate_image(request: Request, input_data: InputImage):
176
+ client = Client("https://hysts-sd-xl.hf.space/--replicas/cplz0/")
177
 
178
  if input_data.style:
179
  print(input_data.style)
 
192
  while attempt < max_attempts:
193
  try:
194
  result = client.predict(
195
+ input_data.input, # str in 'Prompt' Textbox component
196
+ input_data.negativePrompt, # str in 'Negative prompt' Textbox component
197
+ input_data.input, # str in 'Prompt 2' Textbox component
198
+ input_data.negativePrompt, # str in 'Negative prompt 2' Textbox component
199
+ True, # bool in 'Use negative prompt' Checkbox component
200
+ True, # bool in 'Use prompt 2' Checkbox component
201
+ True, # bool in 'Use negative prompt 2' Checkbox component
202
+ input_data.seed, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component
203
+ 1024, # float (numeric value between 256 and 1024) in 'Width' Slider component
204
+ 1024, # float (numeric value between 256 and 1024) in 'Height' Slider component
205
+ input_data.cfg, # float (numeric value between 1 and 20) in 'Guidance scale for base' Slider component
206
+ input_data.cfg, # float (numeric value between 1 and 20) in 'Guidance scale for refiner' Slider component
207
+ input_data.steps, # float (numeric value between 10 and 100) in 'Number of inference steps for base' Slider component
208
+ input_data.steps, # float (numeric value between 10 and 100) in 'Number of inference steps for refiner' Slider component
209
+ True, # bool in 'Apply refiner' Checkbox component
210
+ api_name="/run"
211
  )
212
  image_url = result
213
  with open(image_url, 'rb') as img_file: