stanley commited on
Commit
0c1e008
·
1 Parent(s): 1c71af7

debuggin huggin

Browse files
Files changed (1) hide show
  1. app.py +2 -21
app.py CHANGED
@@ -62,21 +62,6 @@ model_id = "stabilityai/stable-diffusion-2-inpainting"
62
  api_token = "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" # get yours at hf.co/settings/tokens
63
  data = query("The goal of life is [MASK].", model_id, api_token)
64
 
65
-
66
-
67
-
68
- # def get_latest_image_url(database_url):
69
- # response = requests.get(f"{database_url}/latestImage.json")
70
- # latest_image_data = response.json()
71
- # image_url = latest_image_data['downloadURL']
72
- # image_name = latest_image_data['fileName']
73
- # return image_url, image_name
74
-
75
- # database_url = 'https://nyucapstone-7c22c-default-rtdb.firebaseio.com'
76
- # latest_image_url, latest_image_name = get_latest_image_url(database_url)
77
- # print(f"Latest image URL: {latest_image_url}")
78
- # print(f"Latest image name: {latest_image_name}")
79
-
80
  try:
81
  abspath = os.path.abspath(__file__)
82
  dirname = os.path.dirname(abspath)
@@ -84,10 +69,6 @@ try:
84
  except:
85
  pass
86
 
87
- # try:
88
- # from interrogate import Interrogator
89
- # except:
90
- # Interrogator = DummyInterrogator
91
 
92
  USE_NEW_DIFFUSERS = True
93
  RUN_IN_SPACE = "RUN_IN_HG_SPACE" in os.environ
@@ -316,7 +297,7 @@ scheduler_dict = {"PLMS": None, "DDIM": None, "K-LMS": None, "DPM": None, "PNDM"
316
 
317
  class StableDiffusionInpaint:
318
  def __init__(
319
- self, token: str = "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", model_name: str = "", model_path: str = "", **kwargs,
320
  ):
321
  self.token = token
322
  original_checkpoint = False
@@ -817,7 +798,7 @@ class StableDiffusionInpaint:
817
  # return images
818
 
819
 
820
- def get_model(token="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", model_choice="", model_path=""):
821
  if "model" not in model:
822
  model_name = ""
823
  if args.local_model:
 
62
  api_token = "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" # get yours at hf.co/settings/tokens
63
  data = query("The goal of life is [MASK].", model_id, api_token)
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  try:
66
  abspath = os.path.abspath(__file__)
67
  dirname = os.path.dirname(abspath)
 
69
  except:
70
  pass
71
 
 
 
 
 
72
 
73
  USE_NEW_DIFFUSERS = True
74
  RUN_IN_SPACE = "RUN_IN_HG_SPACE" in os.environ
 
297
 
298
  class StableDiffusionInpaint:
299
  def __init__(
300
+ self, token: str = "", model_name: str = "", model_path: str = "", **kwargs,
301
  ):
302
  self.token = token
303
  original_checkpoint = False
 
798
  # return images
799
 
800
 
801
+ def get_model(token="", model_choice="", model_path=""):
802
  if "model" not in model:
803
  model_name = ""
804
  if args.local_model: