ford442 commited on
Commit
3f9f0e6
·
verified ·
1 Parent(s): 71f42d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -85,7 +85,7 @@ neg_prompt_2 = " 'non-photorealistic':1.5, 'unrealistic skin','unattractive face
85
 
86
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
87
 
88
- upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cpu"))
89
 
90
  def load_and_prepare_model():
91
  vaeX=AutoencoderKL.from_pretrained("ford442/stable-diffusion-3.5-large-fp32", safety_checker=None, use_safetensors=True, subfolder='vae', low_cpu_mem_usage=False, torch_dtype=torch.float32, token=True)
@@ -232,7 +232,7 @@ def generate(
232
  output_image_file = f"Large_Lora_L2_{seed}.png"
233
  #image.save(output_image_file,optimize=False,compress_level=0)
234
  #upload_to_ftp(output_image_file)
235
- upscaler.to(torch.device('cuda'))
236
  with torch.no_grad():
237
  upscale2 = upscaler(image, tiling=True, tile_width=256, tile_height=256)
238
  #timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
 
85
 
86
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
87
 
88
+ upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(device)
89
 
90
  def load_and_prepare_model():
91
  vaeX=AutoencoderKL.from_pretrained("ford442/stable-diffusion-3.5-large-fp32", safety_checker=None, use_safetensors=True, subfolder='vae', low_cpu_mem_usage=False, torch_dtype=torch.float32, token=True)
 
232
  output_image_file = f"Large_Lora_L2_{seed}.png"
233
  #image.save(output_image_file,optimize=False,compress_level=0)
234
  #upload_to_ftp(output_image_file)
235
+ #upscaler.to(torch.device('cuda'))
236
  with torch.no_grad():
237
  upscale2 = upscaler(image, tiling=True, tile_width=256, tile_height=256)
238
  #timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")