gsbm commited on
Commit
9fa7e53
·
verified ·
1 Parent(s): b29dae5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -44,6 +44,7 @@ def generate(
44
  num_inference_steps_base: int = 25,
45
  num_inference_steps_refiner: int = 25,
46
  apply_refiner: bool = False,
 
47
  ):
48
  client = Client("hysts/SDXL", hf_token=os.environ['HF_TOKEN'])
49
  result = client.predict(
@@ -64,7 +65,7 @@ def generate(
64
  apply_refiner=apply_refiner,
65
  api_name="/run",
66
  )
67
- image = pixelate(result, 16)
68
  return image
69
 
70
 
@@ -169,6 +170,13 @@ with gr.Blocks(css="style.css") as demo:
169
  step=1,
170
  value=25,
171
  )
 
 
 
 
 
 
 
172
 
173
  gr.Examples(
174
  examples=examples,
@@ -237,6 +245,7 @@ with gr.Blocks(css="style.css") as demo:
237
  num_inference_steps_base,
238
  num_inference_steps_refiner,
239
  apply_refiner,
 
240
  ],
241
  outputs=result,
242
  api_name="run",
 
44
  num_inference_steps_base: int = 25,
45
  num_inference_steps_refiner: int = 25,
46
  apply_refiner: bool = False,
47
+ pixel_size: int = 16
48
  ):
49
  client = Client("hysts/SDXL", hf_token=os.environ['HF_TOKEN'])
50
  result = client.predict(
 
65
  apply_refiner=apply_refiner,
66
  api_name="/run",
67
  )
68
+ image = pixelate(result, pixel_size)
69
  return image
70
 
71
 
 
170
  step=1,
171
  value=25,
172
  )
173
+ pixel_size = gr.Slider(
174
+ label="Pixel size",
175
+ minimum=1,
176
+ maximum=64,
177
+ step=1,
178
+ value=16,
179
+ )
180
 
181
  gr.Examples(
182
  examples=examples,
 
245
  num_inference_steps_base,
246
  num_inference_steps_refiner,
247
  apply_refiner,
248
+ pixel_size
249
  ],
250
  outputs=result,
251
  api_name="run",