minor fixes

This commit is contained in:
Vladimir Mandic
2024-01-22 14:17:56 -05:00
parent 624b0c88b0
commit 14aac11e6c
6 changed files with 20 additions and 5 deletions
+9 -1
View File
@@ -9,6 +9,10 @@ OPTIONAL:
- pending `diffusers==0.26.0`
- wuerstchen v3 [pr](https://github.com/huggingface/diffusers/pull/6487)
- animatediff image2video [pr](https://github.com/huggingface/diffusers/pull/6509)
- tiledvae [pr](https://github.com/huggingface/diffusers/pull/1441)
- style aligned [pr](https://github.com/huggingface/diffusers/pull/6489)
- mixture tiling [pr](https://github.com/huggingface/diffusers/tree/main/examples/community#stable-diffusion-mixture-tiling)
- depth anything [repo](https://depth-anything.github.io/)
- control api
- photomaker api
- interrogate api
@@ -16,7 +20,7 @@ OPTIONAL:
- masking api
- preprocess api
## Update for 2023-01-21
## Update for 2023-01-22
Another big release, highlights being:
- A lot more functionality in the **Control** module:
@@ -151,6 +155,10 @@ As of this release, default backend is set to **diffusers** as its more feature
see wiki page for more details on syntax
thanks @NetroScript
- reduce html overhead
- **model compression**, thanks @Disty0
- using built-in NNCF model compression, you can reduce the size of your models significantly
example: up to 3.4GB of VRAM saved for SD-XL model!
- see [wiki](https://github.com/vladmandic/automatic/wiki/Model-Compression-with-NNCF) for details
- **offline deployment**: allow deployment without git clone
for example, you can now deploy a zip of the sdnext folder
- **latent upscale**: updated latent upscalers (some are new)
+5 -1
View File
@@ -260,12 +260,16 @@ def control_run(units: List[unit.Unit], inputs, inits, mask, unit_type: str, is_
else: # run in txt2img/img2img mode
if len(active_strength) > 0:
p.strength = active_strength[0]
pipe = shared.sd_model
instance = None
"""
try:
pipe = diffusers.AutoPipelineForText2Image.from_pipe(shared.sd_model) # use set_diffuser_pipe
except Exception as e:
shared.log.warning(f'Control pipeline create: {e}')
pipe = shared.sd_model
instance = None
"""
debug(f'Control pipeline: class={pipe.__class__} args={vars(p)}')
t1, t2, t3 = time.time(), 0, 0
+2
View File
@@ -255,6 +255,8 @@ def run_rembg(input_image: Image, input_mask: np.ndarray):
mask = cv2.cvtColor(input_mask, cv2.COLOR_RGB2GRAY)
binary_input = cv2.threshold(input_mask, 127, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
binary_output = cv2.threshold(mask, 127, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
if binary_input.shape != binary_output.shape:
binary_output = cv2.resize(binary_output, binary_input.shape[:2], interpolation=cv2.INTER_LINEAR)
binary_overlap = cv2.bitwise_and(binary_input, binary_output)
input_size = np.count_nonzero(binary_input)
overlap_size = np.count_nonzero(binary_overlap)
+2 -1
View File
@@ -645,6 +645,7 @@ def set_diffuser_options(sd_model, vae = None, op: str = 'model'):
if hasattr(sd_model, "vae"):
if vae is not None:
sd_model.vae = vae
shared.log.debug(f'Setting {op} VAE: name={sd_vae.loaded_vae_file}')
if shared.opts.diffusers_vae_upcast != 'default':
if shared.opts.diffusers_vae_upcast == 'true':
sd_model.vae.config.force_upcast = True
@@ -653,7 +654,7 @@ def set_diffuser_options(sd_model, vae = None, op: str = 'model'):
if shared.opts.no_half_vae:
devices.dtype_vae = torch.float32
sd_model.vae.to(devices.dtype_vae)
shared.log.debug(f'Setting {op} VAE: name={sd_vae.loaded_vae_file} upcast={sd_model.vae.config.get("force_upcast", None)}')
shared.log.debug(f'Setting {op} VAE: upcast={sd_model.vae.config.get("force_upcast", None)}')
if hasattr(sd_model, "enable_model_cpu_offload"):
if (shared.cmd_opts.medvram and devices.backend != "directml") or shared.opts.diffusers_model_cpu_offload:
shared.log.debug(f'Setting {op}: enable model CPU offload')
+1 -1
Submodule wiki updated: 203234e739...e36796b113