Spaces:
briaai
/
Running on Zero

Eyalgut commited on
Commit
d74685a
1 Parent(s): 818ca9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -53,15 +53,14 @@ def infer(prompt,negative_prompt,seed,resolution):
53
 
54
  # generator = torch.Generator("cuda").manual_seed(555)
55
  t=time.time()
56
- if negative_prompt=="":
57
- negative_prompt = default_negative_prompt
58
 
59
  if seed==-1:
60
  generator=None
61
  else:
62
  generator = torch.Generator("cuda").manual_seed(seed)
63
 
64
- w,h = resolution
 
65
  image = pipe(prompt,num_inference_steps=30, negative_prompt=negative_prompt,generator=generator,width=w,height=h).images[0]
66
  print(f'gen time is {time.time()-t} secs')
67
 
@@ -91,9 +90,9 @@ with gr.Blocks(css=css) as demo:
91
  with gr.Group():
92
  with gr.Column():
93
  prompt_in = gr.Textbox(label="Prompt", value="A red colored sports car")
94
- negative_prompt = gr.Textbox(label="Negative Prompt", value="")
95
- resolution = gr.Dropdown(value=(1024,1024), show_label=True, label="Resolution", choices=[(1024,1024),(1344, 768)])
96
  seed = gr.Textbox(label="Seed", value=-1)
 
97
  submit_btn = gr.Button("Generate")
98
  result = gr.Image(label="BRIA-2.2 Result")
99
 
 
53
 
54
  # generator = torch.Generator("cuda").manual_seed(555)
55
  t=time.time()
 
 
56
 
57
  if seed==-1:
58
  generator=None
59
  else:
60
  generator = torch.Generator("cuda").manual_seed(seed)
61
 
62
+ w,h = resolution.split()
63
+ w,h = int(w),int(h)
64
  image = pipe(prompt,num_inference_steps=30, negative_prompt=negative_prompt,generator=generator,width=w,height=h).images[0]
65
  print(f'gen time is {time.time()-t} secs')
66
 
 
90
  with gr.Group():
91
  with gr.Column():
92
  prompt_in = gr.Textbox(label="Prompt", value="A red colored sports car")
93
+ resolution = gr.Dropdown(value="1024 1024", show_label=True, label="Resolution", choices=["1024 1024","1344, 768"])
 
94
  seed = gr.Textbox(label="Seed", value=-1)
95
+ negative_prompt = gr.Textbox(label="Negative Prompt", value=default_negative_prompt)
96
  submit_btn = gr.Button("Generate")
97
  result = gr.Image(label="BRIA-2.2 Result")
98