mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 08:44:33 +02:00
update
This commit is contained in:
+4
-2
@@ -235,8 +235,10 @@ def check_torch():
|
||||
machine = platform.machine()
|
||||
if allow_directml and ('arm' not in machine and 'aarch' not in machine and args.use_directml):
|
||||
log.info('Using DirectML Backend')
|
||||
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.0.0 torchvision==0.15.1 torch-directml')
|
||||
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.0.0 torchaudio torchvision==0.15.1 torch-directml')
|
||||
xformers_package = os.environ.get('XFORMERS_PACKAGE', 'none')
|
||||
if 'torch' in torch_command and not args.version:
|
||||
install(torch_command, 'torch torchvision torchaudio')
|
||||
else:
|
||||
log.info('Using CPU-only Torch')
|
||||
torch_command = os.environ.get('TORCH_COMMAND', 'torch torchaudio torchvision==0.15.1')
|
||||
@@ -480,7 +482,7 @@ def check_version(offline=False, reset=True): # pylint: disable=unused-argument
|
||||
log.error('Not a git repository')
|
||||
if not args.ignore:
|
||||
exit(1)
|
||||
_status = git('status')
|
||||
# status = git('status')
|
||||
# if 'branch' not in status:
|
||||
# log.error('Cannot get git repository status')
|
||||
# exit(1)
|
||||
|
||||
+2
-1
@@ -110,9 +110,10 @@ def set_cuda_params():
|
||||
try:
|
||||
if any([torch.cuda.get_device_capability(devid) == (7, 5) for devid in range(0, torch.cuda.device_count())]): # monkey-patch for old nvidia cards
|
||||
torch.backends.cudnn.benchmark = True
|
||||
torch.backends.cudnn.benchmark_limit = 1
|
||||
else:
|
||||
torch.backends.cudnn.benchmark = shared.opts.cudnn_benchmark
|
||||
torch.backends.cudnn.benchmark_limit = 0
|
||||
torch.backends.cudnn.benchmark_limit = 0
|
||||
torch.backends.cudnn.allow_tf32 = shared.opts.cuda_allow_tf32
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -847,14 +847,12 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
|
||||
for i in range(samples.shape[0]):
|
||||
save_intermediate(samples, i)
|
||||
samples = torch.nn.functional.interpolate(samples, size=(target_height // opt_f, target_width // opt_f), mode=latent_scale_mode["mode"], antialias=latent_scale_mode["antialias"])
|
||||
# Avoid making the inpainting conditioning unless necessary as
|
||||
# this does need some extra compute to decode / encode the image again.
|
||||
if getattr(self, "inpainting_mask_weight", shared.opts.inpainting_mask_weight) < 1.0:
|
||||
image_conditioning = self.img2img_image_conditioning(decode_first_stage(self.sd_model, samples), samples)
|
||||
image_conditioning = self.img2img_image_conditioning(decode_first_stage(self.sd_model, samples.to(dtype=devices.dtype_vae)), samples)
|
||||
else:
|
||||
image_conditioning = self.txt2img_image_conditioning(samples)
|
||||
image_conditioning = self.txt2img_image_conditioning(samples.to(dtype=devices.dtype_vae))
|
||||
else:
|
||||
decoded_samples = decode_first_stage(self.sd_model, samples)
|
||||
decoded_samples = decode_first_stage(self.sd_model, samples.to(dtype=devices.dtype_vae))
|
||||
lowres_samples = torch.clamp((decoded_samples + 1.0) / 2.0, min=0.0, max=1.0)
|
||||
batch_images = []
|
||||
for i, x_sample in enumerate(lowres_samples):
|
||||
|
||||
@@ -60,3 +60,4 @@ transformers==4.26.1
|
||||
timm==0.6.13
|
||||
tomesd==0.1.2
|
||||
urllib3==1.26.15
|
||||
onnxruntime==1.14.0
|
||||
|
||||
Reference in New Issue
Block a user