KingNish commited on
Commit
1c4647b
1 Parent(s): c9efd38

Round Error Solved

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -26,7 +26,7 @@ torch.cuda.empty_cache()
26
  def generate_image(prompt, seed=42, width=DEFAULT_WIDTH, height=DEFAULT_HEIGHT, randomize_seed=False, num_inference_steps=2, progress=gr.Progress(track_tqdm=True)):
27
  if randomize_seed:
28
  seed = random.randint(0, MAX_SEED)
29
- generator = torch.Generator().manual_seed(seed)
30
 
31
  start_time = time.time()
32
 
@@ -78,7 +78,7 @@ with gr.Blocks() as demo:
78
  realtime = gr.Checkbox(label="Realtime Toggler", info="If TRUE then uses more GPU but create image in realtime.", value=False)
79
  latency = gr.Text(label="Latency")
80
  with gr.Row():
81
- seed = gr.Number(label="Seed", value=42, precision=0)
82
  randomize_seed = gr.Checkbox(label="Randomize Seed", value=False)
83
  with gr.Row():
84
  width = gr.Slider(label="Width", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=DEFAULT_WIDTH)
 
26
  def generate_image(prompt, seed=42, width=DEFAULT_WIDTH, height=DEFAULT_HEIGHT, randomize_seed=False, num_inference_steps=2, progress=gr.Progress(track_tqdm=True)):
27
  if randomize_seed:
28
  seed = random.randint(0, MAX_SEED)
29
+ generator = torch.Generator().manual_seed(int(float(seed)))
30
 
31
  start_time = time.time()
32
 
 
78
  realtime = gr.Checkbox(label="Realtime Toggler", info="If TRUE then uses more GPU but create image in realtime.", value=False)
79
  latency = gr.Text(label="Latency")
80
  with gr.Row():
81
+ seed = gr.Number(label="Seed", value=42)
82
  randomize_seed = gr.Checkbox(label="Randomize Seed", value=False)
83
  with gr.Row():
84
  width = gr.Slider(label="Width", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=DEFAULT_WIDTH)