hyper-sd notes

This commit is contained in:
Vladimir Mandic
2024-05-06 17:11:37 -04:00
parent 18898a32c0
commit 38d73e2e51
5 changed files with 40 additions and 11 deletions
+4 -1
View File
@@ -19,7 +19,7 @@ Thanks to @BinaryQuantumSoul for his hard work on this project!
Given huge number of changes with *+3443/-3342 commits diff over the past year, a completely different backend/engine and a change of focus,
it is time to give credit to original [author](https://github.com/auTOMATIC1111), and move on!
## Update for 2024-05-04
## Update for 2024-05-06
- **Features**:
- **ModernUI** preview of the new [ModernUI](https://github.com/BinaryQuantumSoul/sdnext-modernui)
@@ -81,6 +81,9 @@ it is time to give credit to original [author](https://github.com/auTOMATIC1111)
sdxs is an extremely fast 1-step generation consistency model that also uses TAESD as quick VAE out-of-the-box
to use, simply select from *networks -> models -> SDXS*
set parameters: *sampler: CMSI, steps: 1, cfg_scale: 0.0*
- [Hyper-SD](https://huggingface.co/ByteDance/Hyper-SD)
sd15 and sdxl 1-step, 2-step, 4-step and 8-step optimized models using lora
set parameters: *sampler: TCD or LCM, steps: 1/2/4/8, cfg_scale: 0.0*
- **Changes**:
- Removed built-in extensions: *ControlNet* and *Image-Browser*
as both *image-browser* and *controlnet* have native built-in equivalents
@@ -0,0 +1,28 @@
from modules import shared
force_diffusers = [
'aaebf6360f7d', # sd15-lcm
'3d18b05e4f56', # sdxl-lcm
'b71dcb732467', # sdxl-tcd
'813ea5fb1c67', # sdxl-turbo
# not really needed, but just in case
'5a48ac366664', # hyper-sd15-1step
'ee0ff23dcc42', # hyper-sd15-2step
'e476eb1da5df', # hyper-sd15-4step
'ecb844c3f3b0', # hyper-sd15-8step
'1ab289133ebb', # hyper-sd15-8step-cfg
'4f494295edb1', # hyper-sdxl-8step
'ca14a8c621f8', # hyper-sdxl-8step-cfg
'1c88f7295856', # hyper-sdxl-4step
'fdd5dcd1d88a', # hyper-sdxl-2step
'8cca3706050b', # hyper-sdxl-1step
]
def check_override(shorthash):
if len(shorthash) < 4:
return False
force = any([x.startswith(shorthash) for x in force_diffusers])
if force:
shared.log.debug('LoRA override: force diffusers')
return force
+6 -8
View File
@@ -13,6 +13,7 @@ import network_lokr
import network_full
import network_norm
import network_glora
import network_overrides
import lora_convert
import torch
import diffusers.models.lora
@@ -188,18 +189,15 @@ def load_networks(names, te_multipliers=None, unet_multipliers=None, dyn_dims=No
for i, (network_on_disk, name) in enumerate(zip(networks_on_disk, names)):
net = None
if network_on_disk is not None:
shorthash = getattr(network_on_disk, 'shorthash', '').lower()
if debug:
shared.log.debug(f'LoRA load start: name="{name}" file="{network_on_disk.filename}"')
shared.log.debug(f'LoRA load: name="{name}" file="{network_on_disk.filename}" hash="{shorthash}"')
try:
if recompile_model:
shared.compiled_model_state.lora_model.append(f"{name}:{te_multipliers[i] if te_multipliers else 1.0}")
shorthash = getattr(network_on_disk, 'shorthash', '').lower()
if shared.backend == shared.Backend.DIFFUSERS and (shared.opts.lora_force_diffusers # OpenVINO only works with Diffusers LoRa loading.
or shorthash == 'aaebf6360f7d' # sd15-lcm
or shorthash == '3d18b05e4f56' # sdxl-lcm
or shorthash == 'b71dcb732467' # sdxl-tcd
or shorthash == '813ea5fb1c67' # sdxl-turbo
):
if shared.backend == shared.Backend.DIFFUSERS and shared.opts.lora_force_diffusers: # OpenVINO only works with Diffusers LoRa loading
net = load_diffusers(name, network_on_disk, lora_scale=te_multipliers[i] if te_multipliers else 1.0)
elif shared.backend == shared.Backend.DIFFUSERS and network_overrides.check_override(shorthash):
net = load_diffusers(name, network_on_disk, lora_scale=te_multipliers[i] if te_multipliers else 1.0)
else:
net = load_network(name, network_on_disk)
+1 -1
Submodule wiki updated: 9a9539a748...f6d3e5559e