mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
rehost clip-interrogator and update installer
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@
|
||||
ignore = dirty
|
||||
[submodule "extensions-builtin/clip-interrogator-ext"]
|
||||
path = extensions-builtin/clip-interrogator-ext
|
||||
url = https://github.com/pharmapsychotic/clip-interrogator-ext.git
|
||||
url = https://github.com/Dahvikiin/clip-interrogator-ext.git
|
||||
ignore = dirty
|
||||
[submodule "extensions-builtin/sd-webui-controlnet"]
|
||||
path = extensions-builtin/sd-webui-controlnet
|
||||
|
||||
@@ -60,4 +60,6 @@ Tech that can be integrated as part of the core workflow...
|
||||
- git-rebasin
|
||||
- additional upscalers
|
||||
- new image browser
|
||||
- fp8
|
||||
- `fp8`
|
||||
- update `transformers`
|
||||
- `git submodule set-url extensions-builtin/clip-interrogator-ext https://github.com/Dahvikiin/clip-interrogator-ext.git`
|
||||
|
||||
@@ -958,7 +958,7 @@ class LatentDiffusionV1(DDPMV1):
|
||||
cond_list = [{'c_crossattn': [e]} for e in adapted_cond]
|
||||
|
||||
else:
|
||||
cond_list = [cond for i in range(z.shape[-1])] # Todo make this more efficient
|
||||
cond_list = [cond for i in range(z.shape[-1])]
|
||||
|
||||
# apply model by loop over crops
|
||||
output_list = [self.model(z_list[i], t, **cond_list[i]) for i in range(z.shape[-1])]
|
||||
|
||||
Submodule extensions-builtin/a1111-sd-webui-lycoris updated: 123d1da15d...025dea9672
Submodule extensions-builtin/clip-interrogator-ext updated: c0bf90052a...6e31272e14
Submodule extensions-builtin/sd-extension-system-info updated: 5b13bfeeeb...9433a15b89
Submodule extensions-builtin/sd-webui-agent-scheduler updated: 8198489fd4...75ba093d46
Submodule extensions-builtin/sd-webui-controlnet updated: 2785cbe61a...dd766de862
+31
-23
@@ -208,25 +208,32 @@ def git(arg: str, folder: str = None, ignore: bool = False):
|
||||
log.debug(f'Git output: {txt}')
|
||||
return txt
|
||||
|
||||
|
||||
# update switch to main branch as head can get detached and update repository
|
||||
def update(folder):
|
||||
# switch to main branch as head can get detached
|
||||
def branch(folder):
|
||||
if not os.path.exists(os.path.join(folder, '.git')):
|
||||
return
|
||||
branch = git('branch', folder)
|
||||
if 'main' in branch:
|
||||
branch = 'main'
|
||||
elif 'master' in branch:
|
||||
branch = 'master'
|
||||
b = git('branch', folder)
|
||||
if 'main' in b:
|
||||
b = 'main'
|
||||
elif 'master' in b:
|
||||
b = 'master'
|
||||
else:
|
||||
branch = branch.split('\n')[0].replace('*', '').strip()
|
||||
# log.debug(f'Setting branch: {folder} / {branch}')
|
||||
git(f'checkout {branch}', folder)
|
||||
b = b.split('\n')[0].replace('*', '').strip()
|
||||
log.debug(f'Submodule: {folder} / {b}')
|
||||
git(f'checkout {b}', folder, ignore=True)
|
||||
return b
|
||||
|
||||
|
||||
# update git repository
|
||||
def update(folder, current_branch = False):
|
||||
if current_branch:
|
||||
git('pull --autostash --rebase --force', folder)
|
||||
return
|
||||
b = branch(folder)
|
||||
if branch is None:
|
||||
git('pull --autostash --rebase --force', folder)
|
||||
else:
|
||||
git(f'pull origin {branch} --autostash --rebase --force', folder)
|
||||
# branch = git('branch', folder)
|
||||
git(f'pull origin {b} --autostash --rebase --force', folder)
|
||||
|
||||
|
||||
# clone git repository
|
||||
@@ -528,7 +535,7 @@ def install_submodules():
|
||||
pr.enable()
|
||||
log.info('Verifying submodules')
|
||||
txt = git('submodule')
|
||||
log.debug(f'Submodules list: {txt}')
|
||||
# log.debug(f'Submodules list: {txt}')
|
||||
if 'no submodule mapping found' in txt:
|
||||
log.warning('Attempting repository recover')
|
||||
git('add .')
|
||||
@@ -540,15 +547,16 @@ def install_submodules():
|
||||
txt = git('submodule')
|
||||
log.info('Continuing setup')
|
||||
git('submodule --quiet update --init --recursive')
|
||||
if args.upgrade:
|
||||
log.info('Updating submodules')
|
||||
submodules = txt.splitlines()
|
||||
for submodule in submodules:
|
||||
try:
|
||||
name = submodule.split()[1].strip()
|
||||
submodules = txt.splitlines()
|
||||
for submodule in submodules:
|
||||
try:
|
||||
name = submodule.split()[1].strip()
|
||||
if args.upgrade:
|
||||
update(name)
|
||||
except Exception:
|
||||
log.error(f'Error updating submodule: {submodule}')
|
||||
else:
|
||||
branch(name)
|
||||
except Exception:
|
||||
log.error(f'Error updating submodule: {submodule}')
|
||||
if args.profile:
|
||||
print_profile(pr, 'Submodule')
|
||||
|
||||
@@ -653,7 +661,7 @@ def check_version(offline=False, reset=True): # pylint: disable=unused-argument
|
||||
try:
|
||||
git('add .')
|
||||
git('stash')
|
||||
update('.')
|
||||
update('.', current_branch=True)
|
||||
# git('git stash pop')
|
||||
ver = git('log -1 --pretty=format:"%h %ad"')
|
||||
log.info(f'Upgraded to version: {ver}')
|
||||
|
||||
@@ -631,7 +631,7 @@ class LatentDiffusion(DDPM):
|
||||
weighting = weighting * L_weighting
|
||||
return weighting
|
||||
|
||||
def get_fold_unfold(self, x, kernel_size, stride, uf=1, df=1): # todo load once not every time, shorten code
|
||||
def get_fold_unfold(self, x, kernel_size, stride, uf=1, df=1):
|
||||
"""
|
||||
:param x: img of size (bs, c, h, w)
|
||||
:return: n img crops of size (n, bs, c, kernel_size[0], kernel_size[1])
|
||||
@@ -919,7 +919,7 @@ class LatentDiffusion(DDPM):
|
||||
z_list = [z[:, :, :, :, i] for i in range(z.shape[-1])]
|
||||
|
||||
if self.cond_stage_key in ["image", "LR_image", "segmentation",
|
||||
'bbox_img'] and self.model.conditioning_key: # todo check for completeness
|
||||
'bbox_img'] and self.model.conditioning_key:
|
||||
c_key = next(iter(cond.keys())) # get key
|
||||
c = next(iter(cond.values())) # get value
|
||||
assert (len(c) == 1) # todo extend to list with more than one elem
|
||||
@@ -973,12 +973,11 @@ class LatentDiffusion(DDPM):
|
||||
cond_list = [{'c_crossattn': [e]} for e in adapted_cond]
|
||||
|
||||
else:
|
||||
cond_list = [cond for i in range(z.shape[-1])] # Todo make this more efficient
|
||||
cond_list = [cond for i in range(z.shape[-1])]
|
||||
|
||||
# apply model by loop over crops
|
||||
output_list = [self.model(z_list[i], t, **cond_list[i]) for i in range(z.shape[-1])]
|
||||
assert not isinstance(output_list[0],
|
||||
tuple) # todo cant deal with multiple model outputs check this never happens
|
||||
assert not isinstance(output_list[0], tuple)
|
||||
|
||||
o = torch.stack(output_list, axis=-1)
|
||||
o = o * weighting
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ numba==0.57.0
|
||||
pandas==1.5.3
|
||||
protobuf==3.20.3
|
||||
pytorch_lightning==1.9.4
|
||||
transformers==4.26.1
|
||||
transformers==4.30.2
|
||||
timm==0.6.13
|
||||
tomesd==0.1.3
|
||||
urllib3==1.26.15
|
||||
|
||||
@@ -99,7 +99,7 @@ def get_matched_noise(_np_src_image, np_mask_rgb, noise_q=1, color_variation=0.0
|
||||
shaped_noise_fft = _fft2(noise_rgb)
|
||||
shaped_noise_fft[:, :, :] = np.absolute(shaped_noise_fft[:, :, :]) ** 2 * (src_dist ** noise_q) * src_phase # perform the actual shaping
|
||||
|
||||
brightness_variation = 0. # color_variation # todo: temporarily tieing brightness variation to color variation for now
|
||||
brightness_variation = 0. # color_variation
|
||||
contrast_adjusted_np_src = _np_src_image[:] * (brightness_variation + 1.) - brightness_variation * 2.
|
||||
|
||||
# scikit-image is used for histogram matching, very convenient!
|
||||
|
||||
+1
-1
Submodule wiki updated: 28e3cc15ef...503fa982cb
Reference in New Issue
Block a user