TheLastBen commited on
Commit
43b3d85
1 Parent(s): ce93ff0

Upload mainppsComfy.py

Browse files
Files changed (1) hide show
  1. Scripts/mainppsComfy.py +14 -15
Scripts/mainppsComfy.py CHANGED
@@ -150,18 +150,17 @@ def repo():
150
 
151
 
152
 
153
- def mdls(Original_Model_Version, Path_to_MODEL, MODEL_LINK, Temporary_Storage):
154
 
155
  import gdown
156
 
157
-
158
  src=getsrc(MODEL_LINK)
159
 
160
 
161
- call('ln -s /datasets/stable-diffusion-classic/SDv1.5.ckpt /notebooks/ComfyUI/models/checkpoints/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
162
- call('ln -s /datasets/stable-diffusion-v2-1-base-diffusers/stable-diffusion-2-1-base/v2-1_512-nonema-pruned.safetensors /notebooks/ComfyUI/models/checkpoints/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
163
- call('ln -s /datasets/stable-diffusion-v2-1/stable-diffusion-2-1/v2-1_768-nonema-pruned.safetensors /notebooks/ComfyUI/models/checkpoints/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
164
- call('ln -s /datasets/stable-diffusion-xl/sd_xl_base_1.0.safetensors /notebooks/ComfyUI/models/checkpoints/Stable-diffusion', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
165
 
166
  if Path_to_MODEL !='':
167
  if os.path.exists(str(Path_to_MODEL)):
@@ -177,7 +176,7 @@ def mdls(Original_Model_Version, Path_to_MODEL, MODEL_LINK, Temporary_Storage):
177
  if Temporary_Storage:
178
  model=f'/models/{modelname}'
179
  else:
180
- model=f'/notebooks/ComfyUI/models/checkpoints/Stable-diffusion/{modelname}'
181
  if not os.path.exists(model):
182
  dwn(MODEL_LINK, model, 'Downloading the custom model')
183
  clear_output()
@@ -188,7 +187,7 @@ def mdls(Original_Model_Version, Path_to_MODEL, MODEL_LINK, Temporary_Storage):
188
  if Temporary_Storage:
189
  model=f'/models/{modelname}'
190
  else:
191
- model=f'/notebooks/ComfyUI/models/checkpoints/Stable-diffusion/{modelname}'
192
  if not os.path.exists(model):
193
  gdown.download(url=MODEL_LINK, output=model, quiet=False, fuzzy=True)
194
  clear_output()
@@ -199,7 +198,7 @@ def mdls(Original_Model_Version, Path_to_MODEL, MODEL_LINK, Temporary_Storage):
199
  if Temporary_Storage:
200
  model=f'/models/{modelname}'
201
  else:
202
- model=f'/notebooks/ComfyUI/models/checkpoints/Stable-diffusion/{modelname}'
203
  if not os.path.exists(model):
204
  gdown.download(url=MODEL_LINK, output=model, quiet=False, fuzzy=True)
205
  clear_output()
@@ -214,24 +213,24 @@ def mdls(Original_Model_Version, Path_to_MODEL, MODEL_LINK, Temporary_Storage):
214
 
215
  else:
216
  if Original_Model_Version == "v1.5":
217
- model="/notebooks/ComfyUI/models/checkpoints/Stable-diffusion/SDv1.5.ckpt"
218
  print('Using the original V1.5 model')
219
  elif Original_Model_Version == "v2-512":
220
- model="/notebooks/ComfyUI/models/checkpoints/Stable-diffusion/v2-1_512-nonema-pruned.safetensors"
221
  print('Using the original V2-512 model')
222
  elif Original_Model_Version == "v2-768":
223
- model="/notebooks/ComfyUI/models/checkpoints/Stable-diffusion/v2-1_768-nonema-pruned.safetensors"
224
  print('Using the original V2-768 model')
225
  elif Original_Model_Version == "SDXL":
226
- model="/notebooks/ComfyUI/models/checkpoints/Stable-diffusion/sd_xl_base_1.0.safetensors"
227
  print('Using the original SDXL model')
228
  else:
229
- model="/notebooks/ComfyUI/models/checkpoints/Stable-diffusion"
230
  print('Wrong model version, try again')
231
  try:
232
  model
233
  except:
234
- model="/notebooks/ComfyUI/models/checkpoints/Stable-diffusion"
235
 
236
  return model
237
 
 
150
 
151
 
152
 
153
+ def mdls(Original_Model_Version, Path_to_MODEL, MODEL_LINK, Temporary_Storage=False):
154
 
155
  import gdown
156
 
 
157
  src=getsrc(MODEL_LINK)
158
 
159
 
160
+ call('ln -s /datasets/stable-diffusion-classic/SDv1.5.ckpt /notebooks/ComfyUI/models/checkpoints', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
161
+ call('ln -s /datasets/stable-diffusion-v2-1-base-diffusers/stable-diffusion-2-1-base/v2-1_512-nonema-pruned.safetensors /notebooks/ComfyUI/models/checkpoints', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
162
+ call('ln -s /datasets/stable-diffusion-v2-1/stable-diffusion-2-1/v2-1_768-nonema-pruned.safetensors /notebooks/ComfyUI/models/checkpoints', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
163
+ call('ln -s /datasets/stable-diffusion-xl/sd_xl_base_1.0.safetensors /notebooks/ComfyUI/models/checkpoints', shell=True, stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'))
164
 
165
  if Path_to_MODEL !='':
166
  if os.path.exists(str(Path_to_MODEL)):
 
176
  if Temporary_Storage:
177
  model=f'/models/{modelname}'
178
  else:
179
+ model=f'/notebooks/ComfyUI/models/checkpoints/{modelname}'
180
  if not os.path.exists(model):
181
  dwn(MODEL_LINK, model, 'Downloading the custom model')
182
  clear_output()
 
187
  if Temporary_Storage:
188
  model=f'/models/{modelname}'
189
  else:
190
+ model=f'/notebooks/ComfyUI/models/checkpoints/{modelname}'
191
  if not os.path.exists(model):
192
  gdown.download(url=MODEL_LINK, output=model, quiet=False, fuzzy=True)
193
  clear_output()
 
198
  if Temporary_Storage:
199
  model=f'/models/{modelname}'
200
  else:
201
+ model=f'/notebooks/ComfyUI/models/checkpoints/{modelname}'
202
  if not os.path.exists(model):
203
  gdown.download(url=MODEL_LINK, output=model, quiet=False, fuzzy=True)
204
  clear_output()
 
213
 
214
  else:
215
  if Original_Model_Version == "v1.5":
216
+ model="/notebooks/ComfyUI/models/checkpoints/SDv1.5.ckpt"
217
  print('Using the original V1.5 model')
218
  elif Original_Model_Version == "v2-512":
219
+ model="/notebooks/ComfyUI/models/checkpoints/v2-1_512-nonema-pruned.safetensors"
220
  print('Using the original V2-512 model')
221
  elif Original_Model_Version == "v2-768":
222
+ model="/notebooks/ComfyUI/models/checkpoints/v2-1_768-nonema-pruned.safetensors"
223
  print('Using the original V2-768 model')
224
  elif Original_Model_Version == "SDXL":
225
+ model="/notebooks/ComfyUI/models/checkpoints/sd_xl_base_1.0.safetensors"
226
  print('Using the original SDXL model')
227
  else:
228
+ model="/notebooks/ComfyUI/models/checkpoints"
229
  print('Wrong model version, try again')
230
  try:
231
  model
232
  except:
233
+ model="/notebooks/ComfyUI/models/checkpoints"
234
 
235
  return model
236