nightfury commited on
Commit
6770691
1 Parent(s): 60e887d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -54,12 +54,16 @@ def download_image(url):
54
  return PIL.Image.open(BytesIO(response.content)).convert("RGB")
55
 
56
  device = "cuda" if torch.cuda.is_available() else "cpu"
 
 
57
  pipe = StableDiffusionInpaintingPipeline.from_pretrained(
58
- "CompVis/stable-diffusion-v1-4",
59
  revision="fp16",
60
- torch_dtype=torch.float16 if torch.cuda.is_available() else float,
61
- use_auth_token=auth_token,
62
- ).to(device)
 
 
63
 
64
  model = CLIPDensePredT(version='ViT-B/16', reduce_dim=64)
65
  model.eval()
 
54
  return PIL.Image.open(BytesIO(response.content)).convert("RGB")
55
 
56
  device = "cuda" if torch.cuda.is_available() else "cpu"
57
+
58
+ model_id_or_path = "CompVis/stable-diffusion-v1-4"
59
  pipe = StableDiffusionInpaintingPipeline.from_pretrained(
60
+ model_id_or_path,
61
  revision="fp16",
62
+ torch_dtype=torch.float,
63
+ use_auth_token=auth_token
64
+ )
65
+
66
+ pipe = pipe.to(device)
67
 
68
  model = CLIPDensePredT(version='ViT-B/16', reduce_dim=64)
69
  model.eval()