Skip to content
Python

added DreamOmni2 support

deepbeepmeep17b0cdab1564
diff --git a/README.md b/README.md
index 2349521..2073f8f 100644
--- a/README.md
+++ b/README.md
@@ -21,22 +21,23 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models
**Follow DeepBeepMeep on Twitter/X to get the Latest News**: https://x.com/deepbeepmeep
## 🔥 Latest Updates :
-### October 19 2025: WanGP v9.0 - 0.001 Later
+### October 20 2025: WanGP v9.0 - 0.001 Later
-What else do you need ?
+What else will you ever need after this one ?
With WanGP v9 you will have enough features to go on a desert island with no internet connection and comes back with a full Hollywood movie.
First herer are the new models supported:
- **Wan 2.1 Alpha** : a very requested model that can generate videos with *semi transparent background* (as it is very lora picky it supports only the *Self Forcing / lightning* loras accelerators)
- **Chatterbox Multilingual**: the first *Voice Generator* in WanGP. Let's say you have a flu and lost your voice (somehow I can't think of another usecase), the world will still be able to hear you as *Chatterbox* can generate up to 15s clips of your voice using a recorded voice sample. Chatterbox works with numerous languages out the box.
+- **Flux DreamOmni2** : another wannabe *Nano Banana* image Editor / image composer. The *Edit Mode* ("Conditional Image is first Main Subject ...") seems to work better than the *Gen Mode* (Conditional Images are People / Objects ..."). If you have at least 16 GB of VRAM it is recommended to force profile 3 for this model (it uses an autoregressive model for the prompt encoding and the start may be slow).
-Other Features:
+Upgraded Features:
- A new **Audio Gallery** to store your Chatterbox generations and import your audio assets. *Metadata support* (stored gen settings) for *Wav files* generated with WanGP available from day one.
- **Matanyone** improvements: you can now use it during a video gen, it will *suspend gracefully the Gen in progress*. *Input Video / Images* can be resized for faster processing & lower VRAM. Image version can now generate *Green screens* (not used by WanGP but I did it because someone asked for it and I am nice) and *Alpha masks*.
- **Images Stored in Metadata**: Video Gen *Settings Metadata* that are stored in the Generated Videos can now contain the Start Image, Image Refs used to generate the Video. Many thanks to **Gunther-Schulz** for this contribution
- **Three Levels of Hierarchy** to browse the models / finetunes: you can collect as many finetunes as you want now and they will no longer encumber the UI.
-- Added **Loras Accelerators** for Wan 2.1 1.3B and the latest Wan 2.2 Lightning Loras Accelerators
+- Added **Loras Accelerators** for *Wan 2.1 1.3B*, *Wan 2.2 i2v*, *Flux* and the latest *Wan 2.2 Lightning*
- Sometime Less is More: removed the palingenesis finetunes that were controversial
Huge Kudos & Thanks to **Tophness** that has outdone himself with these Great Features:
diff --git a/defaults/flux_dev_kontext_dreamomni2.json b/defaults/flux_dev_kontext_dreamomni2.json
new file mode 100644
index 0000000..75b0fcb
--- /dev/null
+++ b/defaults/flux_dev_kontext_dreamomni2.json
@@ -0,0 +1,19 @@
+{
+ "model": {
+ "name": "Flux 1 DreamOmni2 12B",
+ "architecture": "flux_dev_kontext_dreamomni2",
+ "description": "DreamOmni2 is a Multimodal Instruction-based Editing and Generation Model",
+ "URLs": [
+ "https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1_kontext_dev_bf16.safetensors",
+ "https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1_kontext_dev_quanto_bf16_int8.safetensors"
+ ],
+ "preload_URLs": [ "https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux_dreamomni2_edit_lora.safetensors",
+ "https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux_dreamomni2_gen_lora.safetensors"
+ ]
+ },
+ "prompt": "In the scene, the character from the first image stands on the left, and the character from the second image stands on the right. They are shaking hands against the backdrop of a spaceship interior.",
+ "resolution": "1280x720",
+ "batch_size": 1
+}
+
+
\ No newline at end of file
diff --git a/models/flux/flux_handler.py b/models/flux/flux_handler.py
index cff1af4..85d9f06 100644
--- a/models/flux/flux_handler.py
+++ b/models/flux/flux_handler.py
@@ -10,7 +10,7 @@ def get_ltxv_text_encoder_filename(text_encoder_quantization):
class family_handler():
@staticmethod
def query_supported_types():
- return ["flux", "flux_chroma", "flux_dev_kontext", "flux_dev_umo", "flux_dev_uso", "flux_schnell" ]
+ return ["flux", "flux_chroma", "flux_dev_kontext", "flux_dev_umo", "flux_dev_uso", "flux_schnell", "flux_dev_kontext_dreamomni2" ]
@staticmethod
def query_family_maps():
@@ -21,10 +21,11 @@ class family_handler():
"flux_dev_uso" : "flux",
"flux_schnell" : "flux",
"flux_chroma" : "flux",
+ "flux_dev_kontext_dreamomni2": "flux",
}
models_comp_map = {
- "flux": ["flux_chroma", "flux_dev_kontext", "flux_dev_umo", "flux_dev_uso", "flux_schnell" ]
+ "flux": ["flux_chroma", "flux_dev_kontext", "flux_dev_umo", "flux_dev_uso", "flux_schnell", "flux_dev_kontext_dreamomni2" ]
}
return models_eqv_map, models_comp_map
@staticmethod
@@ -35,12 +36,14 @@ class family_handler():
flux_uso = flux_model == "flux-dev-uso"
flux_umo = flux_model == "flux-dev-umo"
flux_kontext = flux_model == "flux-dev-kontext"
-
+ flux_kontext_dreamomni2 = flux_model == "flux-dev-kontext-dreamomni2"
+
extra_model_def = {
"image_outputs" : True,
"no_negative_prompt" : not flux_chroma,
"flux-model": flux_model,
}
+ extra_model_def["profiles_dir"] = [] if flux_schnell else ["flux"]
if flux_chroma:
extra_model_def["guidance_max_phases"] = 1
elif not flux_schnell:
@@ -56,12 +59,12 @@ class family_handler():
"label": "Reference Images / Style Images"
}
- if flux_kontext:
+ if flux_kontext or flux_kontext_dreamomni2:
extra_model_def["inpaint_support"] = True
extra_model_def["image_ref_choices"] = {
"choices": [
("None", ""),
- ("Conditional Images is first Main Subject / Landscape and may be followed by People / Objects", "KI"),
+ ("Conditional Image is first Main Subject / Landscape and may be followed by People / Objects", "KI"),
("Conditional Images are People / Objects", "I"),
],
"letters_filter": "KI",
@@ -100,12 +103,7 @@ class family_handler():
@staticmethod
def query_model_files(computeList, base_model_type, model_filename, text_encoder_quantization):
text_encoder_filename = get_ltxv_text_encoder_filename(text_encoder_quantization)
- return [
- {
- "repoId" : "DeepBeepMeep/Flux",
- "sourceFolderList" : ["siglip-so400m-patch14-384", "",],
- "fileList" : [ ["config.json", "preprocessor_config.json", "model.safetensors"], ["flux_vae.safetensors"] ]
- },
+ ret = [
{
"repoId" : "DeepBeepMeep/LTX_Video",
"sourceFolderList" : ["T5_xxl_1.1"],
@@ -117,8 +115,32 @@ class family_handler():
"fileList" :[
["config.json", "merges.txt", "model.safetensors", "preprocessor_config.json", "special_tokens_map.json", "tokenizer.json", "tokenizer_config.json", "vocab.json"],
]
- }
- ]
+ },
+ {
+ "repoId" : "DeepBeepMeep/Flux",
+ "sourceFolderList" : ["",],
+ "fileList" : [ ["flux_vae.safetensors"] ]
+ }]
+
+
+ if base_model_type in ["flux_dev_uso"]:
+ ret += [
+ {
+ "repoId" : "DeepBeepMeep/Flux",
+ "sourceFolderList" : ["siglip-so400m-patch14-384"],
+ "fileList" : [ ["config.json", "preprocessor_config.json", "model.safetensors"] ]
+ }]
+
+
+ if base_model_type in ["flux_dev_kontext_dreamomni2"]:
+ ret += [
+ {
+ "repoId" : "DeepBeepMeep/Flux",
+ "sourceFolderList" : ["Qwen2.5-VL-7B-DreamOmni2"],
+ "fileList" : [ ["Qwen2.5-VL-7B-DreamOmni2_quanto_bf16_int8.safetensors", "merges.txt", "tokenizer_config.json", "config.json", "vocab.json", "video_preprocessor_config.json", "preprocessor_config.json", "chat_template.jinja"] ]
+ }]
+
+ return ret
@staticmethod
def load_model(model_filename, model_type, base_model_type, model_def, quantizeTransformer = False, text_encoder_quantization = None, dtype = torch.bfloat16, VAE_dtype = torch.float32, mixed_precision_transformer = False, save_quantized = False, submodel_no_list = None):
@@ -144,6 +166,8 @@ class family_handler():
pipe["siglip_model"] = flux_model.vision_encoder
if flux_model.feature_embedder is not None:
pipe["feature_embedder"] = flux_model.feature_embedder
+ if flux_model.vlm_model is not None:
+ pipe["vlm_model"] = flux_model.vlm_model
return flux_model, pipe
@staticmethod
@@ -165,11 +189,13 @@ class family_handler():
flux_uso = flux_model == "flux-dev-uso"
flux_umo = flux_model == "flux-dev-umo"
flux_kontext = flux_model == "flux-dev-kontext"
+ flux_kontext_dreamomni2 = flux_model == "flux-dev-kontext-dreamomni2"
+
ui_defaults.update({
"embedded_guidance": 2.5,
})
- if flux_kontext or flux_uso:
+ if flux_kontext or flux_uso or flux_kontext_dreamomni2:
ui_defaults.update({
"video_prompt_type": "KI",
"denoising_strength": 1.,
diff --git a/models/flux/flux_main.py b/models/flux/flux_main.py
index 7f18d9d..5a4c7ee 100644
--- a/models/flux/flux_main.py
+++ b/models/flux/flux_main.py
@@ -6,13 +6,14 @@ from glob import iglob
from mmgp import offload as offload
import torch
from shared.utils.utils import calculate_new_dimensions
-from .sampling import denoise, get_schedule, prepare_kontext, prepare_prompt, prepare_multi_ip, unpack
+from .sampling import denoise, get_schedule, prepare_kontext, prepare_prompt, prepare_multi_ip, unpack, resizeinput
from .modules.layers import get_linear_split_map
from transformers import SiglipVisionModel, SiglipImageProcessor
import torchvision.transforms.functional as TVF
import math
from shared.utils.utils import convert_image_to_tensor, convert_tensor_to_image
from shared.utils import files_locator as fl
+from transformers import Qwen2_5_VLForConditionalGeneration, Qwen2Tokenizer, AutoTokenizer, Qwen2VLProcessor
from .util import (
aspect_ratio_to_height_width,
@@ -119,7 +120,13 @@ class model_factory:
self.vision_encoder = siglip_model
self.vision_encoder_processor = siglip_processor
self.feature_embedder = feature_embedder
-
+
+ if self.name in ['flux-dev-kontext-dreamomni2']:
+ self.processor = Qwen2VLProcessor.from_pretrained(fl.locate_folder("Qwen2.5-VL-7B-DreamOmni2"))
+ self.vlm_model = offload.fast_load_transformers_model(fl.locate_file( os.path.join("Qwen2.5-VL-7B-DreamOmni2","Qwen2.5-VL-7B-DreamOmni2_quanto_bf16_int8.safetensors")), writable_tensors= True , modelClass=Qwen2_5_VLForConditionalGeneration, defaultConfigPath= fl.locate_file(os.path.join("Qwen2.5-VL-7B-DreamOmni2", "config.json")))
+ else:
+ self.processor = None
+ self.vlm_model = None
# offload.change_dtype(self.model, dtype, True)
# offload.save_model(self.model, "flux-dev.safetensors")
@@ -135,6 +142,44 @@ class model_factory:
self.model.split_linear_modules_map = split_linear_modules_map
offload.split_linear_modules(self.model, split_linear_modules_map )
+ def infer_vlm(self, input_img_path,input_instruction,prefix):
+ tp=[]
+ for path in input_img_path:
+ tp.append({"type": "image", "image": path})
+ tp.append({"type": "text", "text": input_instruction+prefix})
+ messages = [
+ {
+ "role": "user",
+ "content": tp,
+ }
+ ]
+
+ # Preparation for inference
+ text = self.processor.apply_chat_template(
+ messages, tokenize=False, add_generation_prompt=True
+ )
+ # from .vprocess import process_vision_info
+ # image_inputs, video_inputs = process_vision_info(messages)
+ inputs = self.processor(
+ text=[text],
+ images=input_img_path,
+ # images=image_inputs,
+ # videos=video_inputs,
+ padding=True,
+ return_tensors="pt",
+ )
+ inputs = inputs.to("cpu")
+
+ # Inference
+ generated_ids = self.vlm_model.generate(**inputs, do_sample=False, max_new_tokens=4096)
+ generated_ids_trimmed = [
+ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
+ ]
+ output_text = self.processor.batch_decode(
+ generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
+ )
+ return output_text[0]
+
def generate(
self,
@@ -166,7 +211,8 @@ class model_factory:
device="cuda"
flux_dev_uso = self.name in ['flux-dev-uso']
flux_dev_umo = self.name in ['flux-dev-umo']
- latent_stiching = self.name in ['flux-dev-uso', 'flux-dev-umo']
+ flux_kontext_dreamomni2 = self.name in ['flux-dev-kontext-dreamomni2']
+ latent_stiching = flux_dev_uso or flux_dev_umo or flux_kontext_dreamomni2
lock_dimensions= False
@@ -175,6 +221,15 @@ class model_factory:
ref_long_side = 512 if len(input_ref_images) <= 1 else 320
input_ref_images = [preprocess_ref(img, ref_long_side) for img in input_ref_images]
lock_dimensions = True
+
+ elif flux_kontext_dreamomni2:
+ for i, img in enumerate(input_ref_images):
+ input_ref_images[i] = resizeinput(img)
+ input_prompt= self.infer_vlm(input_ref_images,input_prompt, " It is editing task." if "K" in video_prompt_type else " It is generation task." )
+ input_prompt = input_prompt[6:-7]
+ print(input_prompt)
+ lock_dimensions = True
+
ref_style_imgs = []
if "I" in video_prompt_type and len(input_ref_images) > 0:
if flux_dev_uso :
@@ -205,7 +260,7 @@ class model_factory:
image_mask = None if input_masks is None else convert_tensor_to_image(input_masks, mask_levels= True)
- if self.name in ['flux-dev-uso', 'flux-dev-umo'] :
+ if latent_stiching :
inp, height, width = prepare_multi_ip(
ae=self.vae,
img_cond_list=input_ref_images,
@@ -214,6 +269,10 @@ class model_factory:
bs=batch_size,
seed=seed,
device=device,
+ res_match_output= flux_dev_uso or flux_dev_umo,
+ pe = 'w' if flux_kontext_dreamomni2 else 'd',
+ set_cond_index = flux_kontext_dreamomni2,
+ conditions_zero_start= flux_kontext_dreamomni2
)
else:
inp, height, width = prepare_kontext(
@@ -254,7 +313,6 @@ class model_factory:
x = self.vae.decode(x)
if image_mask is not None:
- from shared.utils.utils import convert_image_to_tensor
img_msk_rebuilt = inp["img_msk_rebuilt"]
img= input_frames.squeeze(1).unsqueeze(0) # convert_image_to_tensor(image_guide)
x = img * (1 - img_msk_rebuilt) + x.to(img) * img_msk_rebuilt
@@ -263,3 +321,10 @@ class model_factory:
x = x.transpose(0, 1)
return x
+ def get_loras_transformer(self, get_model_recursive_prop, model_type, model_mode, video_prompt_type, **kwargs):
+ if model_type != "flux_dev_kontext_dreamomni2": return [], []
+
+ preloadURLs = get_model_recursive_prop(model_type, "preload_URLs")
+ if len(preloadURLs) < 2: return [], []
+ edit = "K" in video_prompt_type
+ return [ fl.locate_file(os.path.basename(preloadURLs[0 if edit else 1]))] , [1]
\ No newline at end of file
diff --git a/models/flux/sampling.py b/models/flux/sampling.py
index 939543c..f9e1bb6 100644
--- a/models/flux/sampling.py
+++ b/models/flux/sampling.py
@@ -129,6 +129,19 @@ def prepare_redux(
"vec": vec.to(img.device),
}
+def resizeinput(img):
+ multiple_of = 16
+ image_height, image_width = img.height, img.width
+ aspect_ratio = image_width / image_height
+ _, image_width, image_height = min(
+ (abs(aspect_ratio - w / h), w, h) for w, h in PREFERED_KONTEXT_RESOLUTIONS
+ )
+ image_width = image_width // multiple_of * multiple_of
+ image_height = image_height // multiple_of * multiple_of
+ if (image_width, image_height) != img.size:
+ img = img.resize((image_width, image_height), Image.LANCZOS)
+ return img
+
def prepare_kontext(
ae: AutoEncoder,
@@ -150,17 +163,14 @@ def prepare_kontext(
height_offset = 0
width_offset = 0
for cond_no, img_cond in enumerate(img_cond_list):
- width, height = img_cond.size
- aspect_ratio = width / height
if res_match_output:
- width, height = target_width, target_height
+ if img_cond.size != (target_width, target_height):
+ img_cond = img_cond.resize((target_width, target_height), Image.Resampling.LANCZOS)
else:
- # Kontext is trained on specific resolutions, using one of them is recommended
- _, width, height = min((abs(aspect_ratio - w / h), w, h) for w, h in PREFERED_KONTEXT_RESOLUTIONS)
- width = 2 * int(width / 16)
- height = 2 * int(height / 16)
+ img_cond = resizeinput(img_cond)
+ width, height = img_cond.size
+ width, height = width // 8, height // 8
- img_cond = img_cond.resize((8 * width, 8 * height), Image.Resampling.LANCZOS)
img_cond = np.array(img_cond)
img_cond = torch.from_numpy(img_cond).float() / 127.5 - 1.0
img_cond = rearrange(img_cond, "h w c -> 1 c h w")
@@ -396,10 +406,20 @@ def prepare_multi_ip(
target_height: int | None = None,
bs: int = 1,
pe: Literal["d", "h", "w", "o"] = "d",
+ conditions_zero_start = False,
+ set_cond_index = False,
+ res_match_output = True,
+
) -> dict[str, Tensor]:
- ref_imgs = img_cond_list
+
assert pe in ["d", "h", "w", "o"]
+ if img_cond_list == None: img_cond_list = []
+
+ if not res_match_output:
+ for i, img_cond in enumerate(img_cond_list):
+ img_cond_list[i]= resizeinput(img_cond)
+
ref_imgs = [
ae.encode(
(TVF.to_tensor(ref_img) * 2.0 - 1.0)
@@ -421,7 +441,10 @@ def prepare_multi_ip(
img_ids[..., 2] = img_ids[..., 2] + torch.arange(w // 2)[None, :]
img_ids = repeat(img_ids, "h w c -> b (h w) c", b=bs)
img_cond_seq = img_cond_seq_ids = None
- pe_shift_w, pe_shift_h = w // 2, h // 2
+ if conditions_zero_start:
+ pe_shift_w = pe_shift_h = 0
+ else:
+ pe_shift_w, pe_shift_h = w // 2, h // 2
for cond_no, ref_img in enumerate(ref_imgs):
_, _, ref_h1, ref_w1 = ref_img.shape
ref_img = rearrange(
@@ -430,7 +453,8 @@ def prepare_multi_ip(
if ref_img.shape[0] == 1 and bs > 1:
ref_img = repeat(ref_img, "1 ... -> bs ...", bs=bs)
ref_img_ids1 = torch.zeros(ref_h1 // 2, ref_w1 // 2, 3)
- # img id分别在宽高偏移各自最大值
+ if set_cond_index:
+ ref_img_ids1[..., 0] = cond_no + 1
h_offset = pe_shift_h if pe in {"d", "h"} else 0
w_offset = pe_shift_w if pe in {"d", "w"} else 0
ref_img_ids1[..., 1] = (
diff --git a/models/flux/util.py b/models/flux/util.py
index 909d6b4..132e94f 100644
--- a/models/flux/util.py
+++ b/models/flux/util.py
@@ -673,6 +673,38 @@ configs = {
shift_factor=0.1159,
),
),
+ "flux-dev-kontext-dreamomni2": ModelSpec(
+ repo_id="",
+ repo_flow="",
+ repo_ae="ckpts/flux_vae.safetensors",
+ params=FluxParams(
+ in_channels=64,
+ out_channels=64,
+ vec_in_dim=768,
+ context_in_dim=4096,
+ hidden_size=3072,
+ mlp_ratio=4.0,
+ num_heads=24,
+ depth=19,
+ depth_single_blocks=38,
+ axes_dim=[16, 56, 56],
+ theta=10_000,
+ qkv_bias=True,
+ guidance_embed=True,
+ eso= True,
+ ),
+ ae_params=AutoEncoderParams(
+ resolution=256,
+ in_channels=3,
+ ch=128,
+ out_ch=3,
+ ch_mult=[1, 2, 4, 4],
+ num_res_blocks=2,
+ z_channels=16,
+ scale_factor=0.3611,
+ shift_factor=0.1159,
+ ),
+ ),
}
diff --git a/models/qwen/qwen_handler.py b/models/qwen/qwen_handler.py
index 9e6b2e6..88a8fe8 100644
--- a/models/qwen/qwen_handler.py
+++ b/models/qwen/qwen_handler.py
@@ -27,7 +27,7 @@ class family_handler():
extra_model_def["image_ref_choices"] = {
"choices": [
("None", ""),
- ("Conditional Images is first Main Subject / Landscape and may be followed by People / Objects", "KI"),
+ ("Conditional Image is first Main Subject / Landscape and may be followed by People / Objects", "KI"),
("Conditional Images are People / Objects", "I"),
],
"letters_filter": "KI",
diff --git a/models/qwen/qwen_main.py b/models/qwen/qwen_main.py
index bf27338..e5fcf85 100644
--- a/models/qwen/qwen_main.py
+++ b/models/qwen/qwen_main.py
@@ -53,8 +53,8 @@ class model_factory():
processor = None
tokenizer = None
if base_model_type in ["qwen_image_edit_20B", "qwen_image_edit_plus_20B"]:
- processor = Qwen2VLProcessor.from_pretrained(os.path.join(checkpoint_dir,"Qwen2.5-VL-7B-Instruct"))
- tokenizer = AutoTokenizer.from_pretrained(os.path.join(checkpoint_dir,"Qwen2.5-VL-7B-Instruct"))
+ processor = Qwen2VLProcessor.from_pretrained(fl.locate_folder("Qwen2.5-VL-7B-Instruct"))
+ tokenizer = AutoTokenizer.from_pretrained(fl.locate_folder("Qwen2.5-VL-7B-Instruct"))
self.base_model_type = base_model_type
base_config_file = "models/qwen/configs/qwen_image_20B.json"
@@ -83,12 +83,12 @@ class model_factory():
from wgp import save_quantized_model
save_quantized_model(transformer, model_type, model_filename[0], dtype, base_config_file)
- text_encoder = offload.fast_load_transformers_model(text_encoder_filename, writable_tensors= True , modelClass=Qwen2_5_VLForConditionalGeneration, defaultConfigPath= os.path.join(checkpoint_dir, "Qwen2.5-VL-7B-Instruct", "config.json"))
+ text_encoder = offload.fast_load_transformers_model(text_encoder_filename, writable_tensors= True , modelClass=Qwen2_5_VLForConditionalGeneration, defaultConfigPath= fl.locate_file(os.path.join("Qwen2.5-VL-7B-Instruct", "config.json")) )
# text_encoder = offload.fast_load_transformers_model(text_encoder_filename, do_quantize=True, writable_tensors= True , modelClass=Qwen2_5_VLForConditionalGeneration, defaultConfigPath="text_encoder_config.json", verboseLevel=2)
# text_encoder.to(torch.float16)
# offload.save_model(text_encoder, "text_encoder_quanto_fp16.safetensors", do_quantize= True)
- vae = offload.fast_load_transformers_model( os.path.join(checkpoint_dir,"qwen_vae.safetensors"), writable_tensors= True , modelClass=AutoencoderKLQwenImage, defaultConfigPath=os.path.join(checkpoint_dir,"qwen_vae_config.json"))
+ vae = offload.fast_load_transformers_model( fl.locate_file("qwen_vae.safetensors"), writable_tensors= True , modelClass=AutoencoderKLQwenImage, defaultConfigPath= fl.locate_file("qwen_vae_config.json"))
self.pipeline = QwenImagePipeline(vae, text_encoder, tokenizer, transformer, processor)
self.vae=vae
diff --git a/profiles/flux/Turbo Alpha 10 Steps.json b/profiles/flux/Turbo Alpha 10 Steps.json
new file mode 100644
index 0000000..4a93412
--- /dev/null
+++ b/profiles/flux/Turbo Alpha 10 Steps.json
@@ -0,0 +1,8 @@
+{
+ "activated_loras": [
+ "https://huggingface.co/DeepBeepMeep/Flux/resolve/main/loras_accelerators/FLUX.1-Turbo-Alpha.safetensors"
+ ],
+ "loras_multipliers": "1",
+ "num_inference_steps": 10,
+ "guidance_scale": 1
+}
diff --git a/wgp.py b/wgp.py
index a58d20b..7f9ef50 100644
--- a/wgp.py
+++ b/wgp.py
@@ -9114,8 +9114,8 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Non
gr.on( triggers=[video_info_extract_audio_settings_btn.click, video_info_extract_image_settings_btn.click], fn=validate_wizard_prompt,
inputs= [state, wizard_prompt_activated_var, wizard_variables_var, prompt, wizard_prompt, *prompt_vars] ,
- outputs= [prompt],
show_progress="hidden",
+ outputs= [prompt],
).then(fn=save_inputs,
inputs =[target_state] + gen_inputs,
outputs= None
@@ -9139,10 +9139,6 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Non
inputs =[target_state] + gen_inputs,
outputs= None
)
-
- main_tabs.select(fn=detect_auto_save_form, inputs= [state], outputs= save_form_trigger, trigger_mode="multiple")
-
-
gr.on(triggers=[video_info_eject_video_btn.click, video_info_eject_video2_btn.click, video_info_eject_video3_btn.click, video_info_eject_image_btn.click], fn=eject_video_from_gallery, inputs =[state, output, last_choice], outputs = [output, video_info, video_buttons_row] )
video_info_to_control_video_btn.click(fn=video_to_control_video, inputs =[state, output, last_choice], outputs = [video_guide] )
@@ -9237,28 +9233,29 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Non
show_progress="hidden",
)
- model_family.input(fn=change_model_family, inputs=[state, model_family], outputs= [model_base_type_choice, model_choice], show_progress="hidden")
- model_base_type_choice.input(fn=change_model_base_types, inputs=[state, model_family, model_base_type_choice], outputs= [model_base_type_choice, model_choice], show_progress="hidden")
+ if tab_id == 'generate':
+ main_tabs.select(fn=detect_auto_save_form, inputs= [state], outputs= save_form_trigger, trigger_mode="multiple")
+ model_family.input(fn=change_model_family, inputs=[state, model_family], outputs= [model_base_type_choice, model_choice], show_progress="hidden")
+ model_base_type_choice.input(fn=change_model_base_types, inputs=[state, model_family, model_base_type_choice], outputs= [model_base_type_choice, model_choice], show_progress="hidden")
- model_choice.change(fn=validate_wizard_prompt,
- inputs= [state, wizard_prompt_activated_var, wizard_variables_var, prompt, wizard_prompt, *prompt_vars] ,
- outputs= [prompt],
- show_progress="hidden",
- ).then(fn=save_inputs,
- inputs =[target_state] + gen_inputs,
- outputs= None
- ).then(fn= change_model,
- inputs=[state, model_choice],
- outputs= [header]
- ).then(fn= fill_inputs,
- inputs=[state],
- outputs=gen_inputs + extra_inputs,
- show_progress="full" if args.debug_gen_form else "hidden",
- ).then(fn= preload_model_when_switching,
- inputs=[state],
- outputs=[gen_status])
+ model_choice.change(fn=validate_wizard_prompt,
+ inputs= [state, wizard_prompt_activated_var, wizard_variables_var, prompt, wizard_prompt, *prompt_vars] ,
+ outputs= [prompt],
+ show_progress="hidden",
+ ).then(fn=save_inputs,
+ inputs =[target_state] + gen_inputs,
+ outputs= None
+ ).then(fn= change_model,
+ inputs=[state, model_choice],
+ outputs= [header]
+ ).then(fn= fill_inputs,
+ inputs=[state],
+ outputs=gen_inputs + extra_inputs,
+ show_progress="full" if args.debug_gen_form else "hidden",
+ ).then(fn= preload_model_when_switching,
+ inputs=[state],
+ outputs=[gen_status])
- if tab_id == 'generate':
generate_btn.click(fn = init_generate, inputs = [state, output, last_choice, audio_files_paths, audio_file_selected], outputs=[generate_trigger, mode])
add_to_queue_btn.click(fn = lambda : (get_unique_id(), ""), inputs = None, outputs=[add_to_queue_trigger, mode])
# gr.on(triggers=[add_to_queue_btn.click, add_to_queue_trigger.change],fn=validate_wizard_prompt,