prithivMLmods commited on
Commit
70dbd46
·
verified ·
1 Parent(s): 19675d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -100,12 +100,12 @@ def generate(
100
 
101
  # Improved options handling
102
  options = {
103
- "prompt": [prompt] * num_images,
104
- "negative_prompt": [negative_prompt] * num_images if use_negative_prompt else None,
105
- "width": width,
106
- "height": height,
107
- "guidance_scale": guidance_scale,
108
- "num_inference_steps": num_inference_steps,
109
  "generator": generator,
110
  "output_type": "pil",
111
  }
@@ -116,7 +116,7 @@ def generate(
116
 
117
  # Generate images potentially in batches
118
  images = []
119
- for i in range(0, num_images, BATCH_SIZE):
120
  batch_options = options.copy()
121
  batch_options["prompt"] = options["prompt"][i:i+BATCH_SIZE]
122
  if "negative_prompt" in batch_options:
@@ -252,7 +252,7 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
252
  num_inference_steps,
253
  randomize_seed,
254
  num_images,
255
- style_selection,
256
  ],
257
  outputs=[result, seed],
258
  api_name="run",
 
100
 
101
  # Improved options handling
102
  options = {
103
+ "prompt": [prompt] * int(num_images),
104
+ "negative_prompt": [negative_prompt] * int(num_images) if use_negative_prompt else None,
105
+ "width": int(width),
106
+ "height": int(height),
107
+ "guidance_scale": float(guidance_scale),
108
+ "num_inference_steps": int(num_inference_steps),
109
  "generator": generator,
110
  "output_type": "pil",
111
  }
 
116
 
117
  # Generate images potentially in batches
118
  images = []
119
+ for i in range(0, int(num_images), BATCH_SIZE):
120
  batch_options = options.copy()
121
  batch_options["prompt"] = options["prompt"][i:i+BATCH_SIZE]
122
  if "negative_prompt" in batch_options:
 
252
  num_inference_steps,
253
  randomize_seed,
254
  num_images,
255
+ style_selection # Added style_selection to inputs
256
  ],
257
  outputs=[result, seed],
258
  api_name="run",