From fb48f5e60bd5f797eb01fac41b12805b0737cbdd Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sat, 12 Apr 2025 11:11:25 -0400 Subject: [PATCH] hidream remote-vae Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 9 ++------- modules/sd_vae_remote.py | 8 ++++---- wiki | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1924f28e..2d5c03d20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,10 @@ - **Models** - [HiDream-I1](https://huggingface.co/HiDream-ai/HiDream-I1-Full) in fast, dev and full variants! - new absolutely massive image generative foundation model with **17B** parameters - and 4 (!?) text-encoders: *clip-l, clip-g, t5-1.1-xxl, llama-3.1-8b-instruct* for total of **8.3B** parameters + new absolutely massive image generative foundation model with **17B** parameters and 4 text-encoders with additional **8.3B** parameters simply select from *networks -> models -> reference* due to size (over 25B params in 58GB), offloading and on-the-fly quantization are pretty much a necessity - custom `llama` model can be set in *settings -> model options* - implementation differens from reference as it bumps up default max token length from 128 to 256 - max token length can be further configured using env variable `HIDREAM_MAX_SEQUENCE_LENGTH` - difference between variants is recommended number of steps: *fast=16, dev=28, full=50* - compatible with: *flowmatching samplers*, *offloading, quantization, taesd live-preview* + see [HiDream Wiki page](https://github.com/vladmandic/sdnext/wiki/HiDream) for details - **Features** - Custom model loader can be used to load any known diffusion model with default or custom model components diff --git a/modules/sd_vae_remote.py b/modules/sd_vae_remote.py index 35c9c6d76..9153d5ebb 100644 --- a/modules/sd_vae_remote.py +++ b/modules/sd_vae_remote.py @@ -55,11 +55,11 @@ def remote_decode(latents: torch.Tensor, width: int = 0, height: int = 0, model_ params = {} try: latent = latent_copy[i] - if model_type != 'f1' and model_type != 'h1': + if model_type != 'f1': latent = latent.unsqueeze(0) - if model_type == 'h1': - num_channels_latents = shared.sd_model.transformer.config.in_channels - latent = h1_pack_latents(latent, 1, num_channels_latents, height, width) # pylint: disable=protected-access + # if model_type == 'h1': + # num_channels_latents = shared.sd_model.transformer.config.in_channels + # latent = h1_pack_latents(latent, 1, num_channels_latents, height, width) # pylint: disable=protected-access params = { "input_tensor_type": "binary", "shape": list(latent.shape), diff --git a/wiki b/wiki index 9f5ee99a8..48f2aa4da 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 9f5ee99a8e6c437801a8727f73acfffe2f0b926e +Subproject commit 48f2aa4da7cc33c4d729089fb075388e3c071599