Manjushri commited on
Commit
aab12d9
1 Parent(s): 64a40e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -18,8 +18,8 @@ upscaler4x = upscaler4x.to(device)
18
 
19
  #define interface
20
 
21
- def upscale(raw_img, model, prompt, negative_prompt, scale, steps):
22
- generator = torch.manual_seed(999999)
23
  raw_img = Image.open(raw_img).convert("RGB")
24
  if model == "Upscaler 4x":
25
  low_res_img = raw_img.resize((128, 128))
@@ -36,7 +36,8 @@ gr.Interface(fn=upscale, inputs=[
36
  gr.Textbox(label="Optional: Enter a Prompt to Slightly Guide the AI's Enhancement"),
37
  gr.Textbox(label='Experimental: Slightly influence What you do not want the AI to Enhance.'),
38
  gr.Slider(2, 15, 7, step=1, label='Guidance Scale: How much the AI influences the Upscaling.'),
39
- gr.Slider(5, 50, 25, step=1, label='Number of Iterations')],
 
40
  outputs=gr.Image(type="filepath", label = 'Upscaled Image'),
41
  title='SD Upscaler',
42
  description='2x Latent Upscaler using SD 2.0 And 4x Upscaler using SD 2.1. This version runs on CPU or GPU and is currently running on a T4 GPU. For 4x Upscaling use images lower than 512x512. For 2x Upscaling use 512x512 to 768x768 images.<br><br><b>Notice: Largest Accepted Resolution is 768x768',
 
18
 
19
  #define interface
20
 
21
+ def upscale(raw_img, model, prompt, negative_prompt, scale, steps, Seed):
22
+ generator = torch.manual_seed(Seed)
23
  raw_img = Image.open(raw_img).convert("RGB")
24
  if model == "Upscaler 4x":
25
  low_res_img = raw_img.resize((128, 128))
 
36
  gr.Textbox(label="Optional: Enter a Prompt to Slightly Guide the AI's Enhancement"),
37
  gr.Textbox(label='Experimental: Slightly influence What you do not want the AI to Enhance.'),
38
  gr.Slider(2, 15, 7, step=1, label='Guidance Scale: How much the AI influences the Upscaling.'),
39
+ gr.Slider(5, 50, 25, step=1, label='Number of Iterations'),
40
+ gr.Slider(min=1, max=999999999999999999, randomize=True, step=1)],
41
  outputs=gr.Image(type="filepath", label = 'Upscaled Image'),
42
  title='SD Upscaler',
43
  description='2x Latent Upscaler using SD 2.0 And 4x Upscaler using SD 2.1. This version runs on CPU or GPU and is currently running on a T4 GPU. For 4x Upscaling use images lower than 512x512. For 2x Upscaling use 512x512 to 768x768 images.<br><br><b>Notice: Largest Accepted Resolution is 768x768',