jiuface commited on
Commit
066bdfe
·
verified ·
1 Parent(s): 18eaa87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -28,7 +28,7 @@ import diffusers
28
 
29
  # init
30
  dtype = torch.bfloat16
31
- device = "cuda" if torch.cuda.is_available() else "cpu"
32
  base_model = "black-forest-labs/FLUX.1-dev"
33
 
34
  # load pipe
@@ -71,11 +71,7 @@ def generate_image(orginal_image, prompt, adapter_names, steps, seed, image_str
71
 
72
  gr.Info("Start to generate images ...")
73
  with calculateDuration(f"Make a new generator: {seed}"):
74
- # if orginal_image:
75
- # img2img_pipe.to(device)
76
- # else:
77
- # txt2img_pipe.to(device)
78
-
79
  generator = torch.Generator(device=device).manual_seed(seed)
80
 
81
  with calculateDuration("Generating image"):
 
28
 
29
  # init
30
  dtype = torch.bfloat16
31
+ device = "cuda"
32
  base_model = "black-forest-labs/FLUX.1-dev"
33
 
34
  # load pipe
 
71
 
72
  gr.Info("Start to generate images ...")
73
  with calculateDuration(f"Make a new generator: {seed}"):
74
+ txt2img_pipe.to(device)
 
 
 
 
75
  generator = torch.Generator(device=device).manual_seed(seed)
76
 
77
  with calculateDuration("Generating image"):