multimodalart HF staff commited on
Commit
6342ca2
1 Parent(s): f9b09af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -4,7 +4,6 @@ import numpy as np
4
  import math
5
  import spaces
6
  import torch
7
- import sys
8
  import random
9
 
10
  from gradio_imageslider import ImageSlider
@@ -28,7 +27,7 @@ def run(prompt, negative_prompt=None, guidance_scale=7.0, pag_scale=3.0, pag_lay
28
  negative_prompt = negative_prompt.strip() if negative_prompt and negative_prompt.strip() else None
29
  print(f"Initial seed for prompt `{prompt}`", seed)
30
  if(randomize_seed):
31
- seed = random.randint(0, sys.maxsize)
32
 
33
  if not prompt and not negative_prompt:
34
  guidance_scale = 0.0
@@ -63,7 +62,7 @@ with gr.Blocks(css=css, theme=theme) as demo:
63
  pag_scale = gr.Number(label="Pag Scale", value=3.0)
64
  pag_layers = gr.Dropdown(label="Model layers to apply Pag to", info="mid is the one used on the paper, up and down blocks seem unstable", choices=["up", "mid", "down"], multiselect=True, value="mid")
65
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
66
- seed = gr.Slider(minimum=1, maximum=18446744073709551615, step=1, randomize=True)
67
  gr.Examples(fn=run, examples=[" ", "an insect robot preparing a delicious meal, anime style", "a photo of a group of friends at an amusement park"], inputs=prompt, outputs=[output, seed], cache_examples=True)
68
  gr.on(
69
  triggers=[
 
4
  import math
5
  import spaces
6
  import torch
 
7
  import random
8
 
9
  from gradio_imageslider import ImageSlider
 
27
  negative_prompt = negative_prompt.strip() if negative_prompt and negative_prompt.strip() else None
28
  print(f"Initial seed for prompt `{prompt}`", seed)
29
  if(randomize_seed):
30
+ seed = random.randint(0, 999999999999999)
31
 
32
  if not prompt and not negative_prompt:
33
  guidance_scale = 0.0
 
62
  pag_scale = gr.Number(label="Pag Scale", value=3.0)
63
  pag_layers = gr.Dropdown(label="Model layers to apply Pag to", info="mid is the one used on the paper, up and down blocks seem unstable", choices=["up", "mid", "down"], multiselect=True, value="mid")
64
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
65
+ seed = gr.Slider(minimum=1, maximum=999999999999999, step=1, randomize=True)
66
  gr.Examples(fn=run, examples=[" ", "an insect robot preparing a delicious meal, anime style", "a photo of a group of friends at an amusement park"], inputs=prompt, outputs=[output, seed], cache_examples=True)
67
  gr.on(
68
  triggers=[