jiuface commited on
Commit
715a594
·
verified ·
1 Parent(s): 98e10c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -114,6 +114,8 @@ def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, s
114
  gr.Info("Starting process")
115
  img2img_model = False
116
  orginal_image = None
 
 
117
  print(device)
118
 
119
  # Set random seed for reproducibility
@@ -168,10 +170,10 @@ def run_lora(prompt, image_url, lora_strings_json, image_strength, cfg_scale, s
168
  gr.Info("Start to generate images ...")
169
  print(device)
170
  # Generate image
171
- txt2img_pipe.to(device)
172
- generator = torch.Generator(device=device).manual_seed(seed)
173
  joint_attention_kwargs = {"scale": 1}
174
- final_image = txt2img_pipe(
175
  prompt=prompt,
176
  num_inference_steps=steps,
177
  guidance_scale=cfg_scale,
 
114
  gr.Info("Starting process")
115
  img2img_model = False
116
  orginal_image = None
117
+ device = txt2img_pipe.device
118
+
119
  print(device)
120
 
121
  # Set random seed for reproducibility
 
170
  gr.Info("Start to generate images ...")
171
  print(device)
172
  # Generate image
173
+ pipe = txt2img_pipe.to(device)
174
+ generator = torch.Generator("cuda").manual_seed(seed)
175
  joint_attention_kwargs = {"scale": 1}
176
+ final_image = pipe(
177
  prompt=prompt,
178
  num_inference_steps=steps,
179
  guidance_scale=cfg_scale,