mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
+2
-1
@@ -3,7 +3,7 @@
|
||||
## Update for 2025-05-15
|
||||
|
||||
*Curious how your system is performing?*
|
||||
Run a built-in benchmark and compare to over 15k unique results world-wide: (Benchmark data)[https://vladmandic.github.io/sd-extension-system-info/pages/benchmark.html]!
|
||||
Run a built-in benchmark and compare to over 15k unique results world-wide: [Benchmark data](https://vladmandic.github.io/sd-extension-system-info/pages/benchmark.html)!
|
||||
From slowest 0.02 it/s running on 6th gen CPU without acceleration up to 275+ it/s running on tuned GH100 system!
|
||||
|
||||
Also, since quantization is becoming a necessity for almost all new models, see comparison of different quantization methods available in SD.Next: [Quantization](https://vladmandic.github.io/sdnext-docs/Quantization/)
|
||||
@@ -26,6 +26,7 @@ Btw, last few releases have been smaller, but more regular so do check posts abo
|
||||
- Gradio: major cleanup and fixing defaults and ranges
|
||||
- Pydantic: update to api types
|
||||
- UI defaults: match correct prompt components
|
||||
- NNCF with ControlNet
|
||||
|
||||
## Update for 2025-05-12
|
||||
|
||||
|
||||
@@ -433,7 +433,6 @@ def control_run(state: str = '',
|
||||
original_pipeline = shared.sd_model
|
||||
shared.sd_model = pipe
|
||||
sd_models.move_model(shared.sd_model, shared.device)
|
||||
shared.sd_model.to(dtype=devices.dtype)
|
||||
debug_log(f'Control device={devices.device} dtype={devices.dtype}')
|
||||
sd_models.copy_diffuser_options(shared.sd_model, original_pipeline) # copy options from original pipeline
|
||||
sd_models.set_diffuser_options(shared.sd_model)
|
||||
|
||||
@@ -61,7 +61,6 @@ def instant_id(p: processing.StableDiffusionProcessing, app, source_images, stre
|
||||
shared.sd_model.load_ip_adapter_instantid(face_adapter, scale=strength)
|
||||
shared.sd_model.set_ip_adapter_scale(strength)
|
||||
sd_models.move_model(shared.sd_model, devices.device) # move pipeline to device
|
||||
shared.sd_model.to(dtype=devices.dtype)
|
||||
|
||||
# pipeline specific args
|
||||
if p.all_prompts is None or len(p.all_prompts) == 0:
|
||||
|
||||
@@ -61,12 +61,33 @@ def hidream_rope(pos: torch.Tensor, dim: int, theta: int) -> torch.Tensor:
|
||||
return out.to(return_device, dtype=torch.float32)
|
||||
|
||||
|
||||
def get_1d_sincos_pos_embed_from_grid(embed_dim, pos, output_type="np"):
|
||||
if output_type == "np":
|
||||
return diffusers.models.embeddings.get_1d_sincos_pos_embed_from_grid_np(embed_dim=embed_dim, pos=pos)
|
||||
if embed_dim % 2 != 0:
|
||||
raise ValueError("embed_dim must be divisible by 2")
|
||||
|
||||
omega = torch.arange(embed_dim // 2, device=pos.device, dtype=torch.float32)
|
||||
omega /= embed_dim / 2.0
|
||||
omega = 1.0 / 10000**omega # (D/2,)
|
||||
|
||||
pos = pos.reshape(-1) # (M,)
|
||||
out = torch.outer(pos, omega) # (M, D/2), outer product
|
||||
|
||||
emb_sin = torch.sin(out) # (M, D/2)
|
||||
emb_cos = torch.cos(out) # (M, D/2)
|
||||
|
||||
emb = torch.concat([emb_sin, emb_cos], dim=1) # (M, D)
|
||||
return emb
|
||||
|
||||
|
||||
def ipex_diffusers(device_supports_fp64=False, can_allocate_plus_4gb=False):
|
||||
diffusers.utils.torch_utils.fourier_filter = fourier_filter
|
||||
if not device_supports_fp64:
|
||||
# get around lazy imports
|
||||
from diffusers.models import transformers as diffusers_transformers # pylint: disable=import-error, unused-import # noqa: F401
|
||||
from diffusers.models import controlnets as diffusers_controlnets # pylint: disable=import-error, unused-import # noqa: F401
|
||||
diffusers.models.embeddings.get_1d_sincos_pos_embed_from_grid = get_1d_sincos_pos_embed_from_grid
|
||||
diffusers.models.embeddings.FluxPosEmbed = FluxPosEmbed
|
||||
diffusers.models.transformers.transformer_flux.FluxPosEmbed = FluxPosEmbed
|
||||
diffusers.models.controlnets.controlnet_flux.FluxPosEmbed = FluxPosEmbed
|
||||
|
||||
@@ -110,7 +110,6 @@ class Script(scripts.Script):
|
||||
sd_models.copy_diffuser_options(shared.sd_model, orig_pipeline) # copy options from original pipeline
|
||||
sd_models.set_diffuser_options(shared.sd_model) # set all model options such as fp16, offload, etc.
|
||||
sd_models.move_model(shared.sd_model, devices.device) # move pipeline to device
|
||||
shared.sd_model.to(dtype=devices.dtype)
|
||||
|
||||
# if pipeline also needs a specific type, you can set it here, but not commonly needed
|
||||
# shared.sd_model = sd_models.set_diffuser_pipe(shared.sd_model, sd_models.DiffusersTaskType.IMAGE_2_IMAGE)
|
||||
|
||||
+1
-1
Submodule wiki updated: 6192bb85f1...25c8a39ade
Reference in New Issue
Block a user