Paweł Klimkowski commited on
Commit
f9d9198
·
1 Parent(s): 468ce6d

feat: limit

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float
8
 
9
  def inference(prompt, num_samples):
10
  all_images = []
11
- images = pipe(prompt, num_images_per_prompt=num_samples, num_inference_steps=50, guidance_scale=7.5).images
12
  all_images.extend(images)
13
  return all_images
14
 
@@ -17,7 +17,7 @@ with gr.Blocks() as demo:
17
  with gr.Row():
18
  with gr.Column():
19
  prompt = gr.Textbox(label="prompt")
20
- samples = gr.Slider(label="Samples",value=1)
21
  run = gr.Button(value="Run")
22
  with gr.Column():
23
  gallery = gr.Gallery(show_label=False)
 
8
 
9
  def inference(prompt, num_samples):
10
  all_images = []
11
+ images = pipe(prompt,height=512, width=768, num_images_per_prompt=num_samples, num_inference_steps=70, guidance_scale=7.5).images
12
  all_images.extend(images)
13
  return all_images
14
 
 
17
  with gr.Row():
18
  with gr.Column():
19
  prompt = gr.Textbox(label="prompt")
20
+ samples = gr.Slider(label="Samples",value=1, step=1, maximum=6)
21
  run = gr.Button(value="Run")
22
  with gr.Column():
23
  gallery = gr.Gallery(show_label=False)