vittore commited on
Commit
cab00f7
1 Parent(s): 54577b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -25,7 +25,7 @@ from illusion_style import css
25
  BASE_MODEL = "SG161222/Realistic_Vision_V5.1_noVAE"
26
 
27
 
28
- device='cuda'
29
 
30
  # Initialize both pipelines
31
  vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
@@ -37,7 +37,7 @@ main_pipe = StableDiffusionControlNetPipeline.from_pretrained(
37
  vae=vae,
38
  safety_checker=None,
39
  torch_dtype=torch.float16,
40
- ).to("cuda")
41
 
42
  #main_pipe.unet = torch.compile(main_pipe.unet, mode="reduce-overhead", fullgraph=True)
43
  #main_pipe.unet.to(memory_format=torch.channels_last)
@@ -141,7 +141,7 @@ def inference(
141
 
142
  main_pipe.scheduler = SAMPLER_MAP[sampler](main_pipe.scheduler.config)
143
  my_seed = random.randint(0, 2**32 - 1) if seed == -1 else seed
144
- generator = torch.Generator(device="cuda").manual_seed(my_seed)
145
 
146
  out = main_pipe(
147
  prompt=prompt,
 
25
  BASE_MODEL = "SG161222/Realistic_Vision_V5.1_noVAE"
26
 
27
 
28
+ device='cpu'
29
 
30
  # Initialize both pipelines
31
  vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
 
37
  vae=vae,
38
  safety_checker=None,
39
  torch_dtype=torch.float16,
40
+ ).to(device)
41
 
42
  #main_pipe.unet = torch.compile(main_pipe.unet, mode="reduce-overhead", fullgraph=True)
43
  #main_pipe.unet.to(memory_format=torch.channels_last)
 
141
 
142
  main_pipe.scheduler = SAMPLER_MAP[sampler](main_pipe.scheduler.config)
143
  my_seed = random.randint(0, 2**32 - 1) if seed == -1 else seed
144
+ generator = torch.Generator(device=device).manual_seed(my_seed)
145
 
146
  out = main_pipe(
147
  prompt=prompt,