linoyts HF Staff commited on
Commit
489aca1
·
verified ·
1 Parent(s): 73cbe25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -44,7 +44,7 @@ def generate_image(prompt, height, width, num_inference_steps, seed=42, randomiz
44
  width=int(width),
45
  num_inference_steps=int(num_inference_steps),
46
  guidance_scale=0.0, # Guidance should be 0 for Turbo models
47
- generator = torch.Generator(device=device).manual_seed(seed)
48
  ).images[0]
49
 
50
  image_no_lora = pipe_no_lora(
@@ -53,7 +53,7 @@ def generate_image(prompt, height, width, num_inference_steps, seed=42, randomiz
53
  width=int(width),
54
  num_inference_steps=int(num_inference_steps),
55
  guidance_scale=0.0, # Guidance should be 0 for Turbo models
56
- generator = torch.Generator(device=device).manual_seed(seed)
57
  ).images[0]
58
 
59
  return (image_no_lora,image), seed
@@ -67,9 +67,9 @@ examples = [
67
  ["Astronaut riding a horse on Mars, cinematic lighting, sci-fi concept art, highly detailed"],
68
  ["Portrait of a wise old wizard with a long white beard, holding a glowing crystal staff, magical forest background"],
69
  ]
70
- css = '''#col-container { max-width: 1000px; margin: 0 auto; }
71
  .dark .progress-text{color: white !important}
72
- #examples{max-width: 1000px; margin: 0 auto; }'''
73
  # Build the Gradio interface
74
  with gr.Blocks() as demo:
75
 
 
44
  width=int(width),
45
  num_inference_steps=int(num_inference_steps),
46
  guidance_scale=0.0, # Guidance should be 0 for Turbo models
47
+ generator = torch.Generator(device="cuda").manual_seed(seed)
48
  ).images[0]
49
 
50
  image_no_lora = pipe_no_lora(
 
53
  width=int(width),
54
  num_inference_steps=int(num_inference_steps),
55
  guidance_scale=0.0, # Guidance should be 0 for Turbo models
56
+ generator = torch.Generator(device="cuda").manual_seed(seed)
57
  ).images[0]
58
 
59
  return (image_no_lora,image), seed
 
67
  ["Astronaut riding a horse on Mars, cinematic lighting, sci-fi concept art, highly detailed"],
68
  ["Portrait of a wise old wizard with a long white beard, holding a glowing crystal staff, magical forest background"],
69
  ]
70
+ css = '''#col-container { max-width: 900px; margin: 0 auto; }
71
  .dark .progress-text{color: white !important}
72
+ #examples{max-width: 900px; margin: 0 auto; }'''
73
  # Build the Gradio interface
74
  with gr.Blocks() as demo:
75