PatrickSchrML commited on
Commit
e1206c6
1 Parent(s): aa28ec8
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -28,6 +28,8 @@ def safe_sd(prompt, n_samples, steps, scale, seed):
28
  "steps": steps,
29
  "seed": seed,
30
  "guidance_scale": scale,
 
 
31
  })
32
  return res
33
 
@@ -53,9 +55,10 @@ def infer(prompt, n_samples, steps, scale, seed):
53
  # images.append(image)
54
  # else:
55
  url = os.getenv('BACKEND_URL')
56
- response = safe_sd(prompt, int(n_samples), max(50,int(steps)), f'{scale:.1f}', int(seed))
57
  #requests.get(url.format(prompt, int(n_samples), max(50,int(steps)), f'{scale:.1f}', int(seed)))
58
  #response = requests.get(url.format('a%20naked%20girl', 2, 50, 7.5, 2))
 
59
  data = json.load(BytesIO(response.content))
60
  #data = response.json()
61
  print(data)
 
28
  "steps": steps,
29
  "seed": seed,
30
  "guidance_scale": scale,
31
+ }, headers={
32
+ "User-Agent": "hfdemo"
33
  })
34
  return res
35
 
 
55
  # images.append(image)
56
  # else:
57
  url = os.getenv('BACKEND_URL')
58
+ response = safe_sd(prompt, int(n_samples), max(50,int(steps)), scale, seed)
59
  #requests.get(url.format(prompt, int(n_samples), max(50,int(steps)), f'{scale:.1f}', int(seed)))
60
  #response = requests.get(url.format('a%20naked%20girl', 2, 50, 7.5, 2))
61
+ print(response)
62
  data = json.load(BytesIO(response.content))
63
  #data = response.json()
64
  print(data)