236 # -----==========----- 237 238 def check_git(): 239 print("Checking git version") 240 ec = os.system("git --version") 241 if ec != 0: 242 print("Please make sure git is installed on your system") 243 return False
236 # -----==========----- 237 238 def check_git(): 239 print("Checking git version") 240 ec = os.system("git --version") 241 if ec != 0: 242 print("Please make sure git is installed on your system") 243 return False
263 if ext_path_exists: 264 os.chdir(ext_path) 265 266 print("Fetching latest commits from the git repository") 267 ec = os.system("git fetch --all") 268 if ec != 0: 269 print("The command 'git fetch' failed, please restart the install script to try again") 270 return False
263 if ext_path_exists: 264 os.chdir(ext_path) 265 266 print("Fetching latest commits from the git repository") 267 ec = os.system("git fetch --all") 268 if ec != 0: 269 print("The command 'git fetch' failed, please restart the install script to try again") 270 return False
274 else: 275 os.chdir(extensions_folder) 276 277 print("Cloning SeargeSDXL from the git repository") 278 ec = os.system(f"git clone {SEARGE_SDXL_GIT_URL}") 279 if ec != 0: 280 print(f"The command 'git clone' failed, please delete the directory {ext_path} and " 281 "restart the install script to try again")
291 292 if inp == "t": 293 os.chdir(ext_path) 294 295 ec = os.system("git stash") 296 if ec == 0: 297 ec = os.system("git switch -C dev origin/dev") 298
291 292 if inp == "t": 293 os.chdir(ext_path) 294 295 ec = os.system("git stash") 296 if ec == 0: 297 ec = os.system("git switch -C dev origin/dev") 298
293 os.chdir(ext_path) 294 295 ec = os.system("git stash") 296 if ec == 0: 297 ec = os.system("git switch -C dev origin/dev") 298 299 os.chdir(old_cwd) 300
293 os.chdir(ext_path) 294 295 ec = os.system("git stash") 296 if ec == 0: 297 ec = os.system("git switch -C dev origin/dev") 298 299 os.chdir(old_cwd) 300
300 301 elif inp == "r": 302 os.chdir(ext_path) 303 304 ec = os.system("git stash") 305 if ec == 0: 306 ec = os.system("git switch -C main origin/main") 307
300 301 elif inp == "r": 302 os.chdir(ext_path) 303 304 ec = os.system("git stash") 305 if ec == 0: 306 ec = os.system("git switch -C main origin/main") 307
302 os.chdir(ext_path) 303 304 ec = os.system("git stash") 305 if ec == 0: 306 ec = os.system("git switch -C main origin/main") 307 308 os.chdir(old_cwd) 309
302 os.chdir(ext_path) 303 304 ec = os.system("git stash") 305 if ec == 0: 306 ec = os.system("git switch -C main origin/main") 307 308 os.chdir(old_cwd) 309
443 counter["last"] = mb 444 print(f"Transferred {mb} MB / {tmb} MB") 445 446 try: 447 request.urlretrieve(dl_url, full_path, progress) 448 449 except ContentTooShortError: 450 print("Download incomplete")
84 85 input_image = HWC3(input_image) 86 input_image = resize_image(input_image, detect_resolution) 87 88 assert input_image.ndim == 3 89 H, W, C = input_image.shape 90 with torch.no_grad(): 91 image_hed = torch.from_numpy(input_image.copy()).float().to(device)
43 44 input_image = HWC3(input_image) 45 input_image = resize_image(input_image, detect_resolution) 46 47 assert input_image.ndim == 3 48 height, width, dim = input_image.shape 49 50 with torch.no_grad():
19 return torch.stack(out_list, dim=0) 20 21 22 def HWC3(x): 23 assert x.dtype == np.uint8 24 25 if x.ndim == 2: 26 x = x[:, :, None]
23 assert x.dtype == np.uint8 24 25 if x.ndim == 2: 26 x = x[:, :, None] 27 assert x.ndim == 3 28 29 H, W, C = x.shape 30 assert C == 1 or C == 3 or C == 4
26 x = x[:, :, None] 27 assert x.ndim == 3 28 29 H, W, C = x.shape 30 assert C == 1 or C == 3 or C == 4 31 32 if C == 3: 33 return x
42 def __init__(self): 43 super().__init__() 44 self.output_dir = folder_paths.get_temp_directory() 45 self.type = "temp" 46 self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for _ in range(5)) 47 48 @classmethod 49 def INPUT_TYPES(cls):