ford442 commited on
Commit
779923e
·
verified ·
1 Parent(s): 41d77c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -81,7 +81,7 @@ neg_prompt_2 = " 'non-photorealistic':1.5, 'unrealistic skin','unattractive face
81
 
82
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
83
 
84
- upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
85
 
86
  def load_and_prepare_model():
87
  vaeXL = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", safety_checker=None, use_safetensors=False) #.to(device=device, dtype=torch.bfloat16)
@@ -228,8 +228,8 @@ def generate(
228
  if segment==8:
229
  final_latents = current_latents
230
  final_latents = final_latents / pipe.vae.config.scaling_factor
231
- with torch.no_grad():
232
- image = pipe.vae.decode(final_latents, return_dict=False)[0]
233
  image = pipe.image_processor.postprocess(image, output_type="pil")[0]
234
  output_image_file = f"rv_L_{seed}.png"
235
  image.save(output_image_file)
 
81
 
82
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
83
 
84
+ upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cpu"))
85
 
86
  def load_and_prepare_model():
87
  vaeXL = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", safety_checker=None, use_safetensors=False) #.to(device=device, dtype=torch.bfloat16)
 
228
  if segment==8:
229
  final_latents = current_latents
230
  final_latents = final_latents / pipe.vae.config.scaling_factor
231
+ #with torch.no_grad():
232
+ image = pipe.vae.decode(final_latents, return_dict=False)[0]
233
  image = pipe.image_processor.postprocess(image, output_type="pil")[0]
234
  output_image_file = f"rv_L_{seed}.png"
235
  image.save(output_image_file)