fix: comprehensive substrate fork v2 + bump diffusers to >=0.34.0 (FLAX_WEIGHTS_NAME fix)
Browse filesThe substrate as vendored has eager imports of diffusers classes that no
longer exist in current diffusers (0.32.2 pinned by requirements.txt),
plus the FLAX_WEIGHTS_NAME issue (transformers 5.5+ removed it, diffusers
0.32.2 still imports it). PR https://github.com/huggingface/diffusers/pull/12354
fixed FLAX in diffusers >=0.34.0.
This commit:
1. Dockerfile: bump diffusers from ==0.32.2 to >=0.34.0 (gets the
FLAX_WEIGHTS_NAME fix from PR 12354). Keep transformers 5.5.3 (FLUX works
on transformers 5.x).
2. comprehensive_fork.py: re-wrapped 182 files, 290 import blocks. The
patcher now uses substring matching (not regex), so it catches both
'from diffusers import ...' (top-level) AND 'from diffusers.pipelines.X
import ...' (sub-module). Multi-line imports are joined via '\\\\' continuation
handling before the defer check fires.
3. /reset_fork.py: utility to clear SPOCK-FORK markers so the patcher
re-processes (used before this commit to recover from the double-wrap
that happened when the re-wrap pass hit already-wrapped files).
4. L2 audit script updated to do the substring match (was regex, missed
many sub-module imports).
The patches defer SD 1.x/2.x/SDXL/Wan/AuraFlow/Hunyuan/SD3 classes
the FLUX path doesn't use. FLUX classes (FluxPipeline, FluxTransformer2DModel,
FlowMatchEulerDiscreteScheduler, AutoencoderKL, safetensors.torch) are
kept eager.
- Dockerfile +9 -2
- ai-toolkit/extensions_built_in/advanced_generator/Img2ImgGenerator.py +16 -2
- ai-toolkit/extensions_built_in/advanced_generator/ReferenceGenerator.py +16 -2
- ai-toolkit/extensions_built_in/audio_models/ace_step/ace_step_15_model.py +8 -1
- ai-toolkit/extensions_built_in/captioner/AceStepCaptioner.py +8 -1
- ai-toolkit/extensions_built_in/captioner/Qwen3VLCaptioner.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/boogu_image/boogu_image.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/boogu_image/src/pipeline.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/boogu_image/src/transformer.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/chroma/chroma_model.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/chroma/chroma_radiance_model.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/ernie_image/ernie_image.py +16 -1
- ai-toolkit/extensions_built_in/diffusion_models/example_model/example_model.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/example_model/src/__init__.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/f_light/f_light.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/flux2/flux2_klein_model.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/flux2/flux2_model.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/flux_kontext/flux_kontext.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/hidream/hidream_e1_model.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/hidream/hidream_model.py +24 -3
- ai-toolkit/extensions_built_in/diffusion_models/hidream/hidream_o1_model.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/hidream/src/__init__.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/hidream/src/models/transformers/transformer_hidream_image.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/hidream/src/pipelines/hidream_image/pipeline_hidream_image.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/hidream/src/pipelines/hidream_image/pipeline_hidream_image_editing.py +20 -0
- ai-toolkit/extensions_built_in/diffusion_models/ideogram4/ideogram4.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/krea2/krea2.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/ltx2/ltx2.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/nucleus_image/nucleus_image_model.py +16 -1
- ai-toolkit/extensions_built_in/diffusion_models/omnigen2/__init__.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/omnigen2/src/models/transformers/__init__.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/omnigen2/src/models/transformers/transformer_omnigen2.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/omnigen2/src/pipelines/omnigen2/pipeline_omnigen2.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/omnigen2/src/pipelines/omnigen2/pipeline_omnigen2_chat.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/prx_pixel_t2i/prx_pixel_t2i.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/prx_pixel_t2i/src/__init__.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/prx_pixel_t2i/src/transformer_prx.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/qwen_image/qwen_image.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/qwen_image/qwen_image_edit.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/qwen_image/qwen_image_edit_plus.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/wan22/wan22_14b_i2v_model.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/wan22/wan22_14b_model.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/wan22/wan22_5b_model.py +8 -1
- ai-toolkit/extensions_built_in/diffusion_models/wan22/wan22_pipeline.py +16 -2
- ai-toolkit/extensions_built_in/diffusion_models/z_image/z_image.py +16 -1
- ai-toolkit/extensions_built_in/diffusion_models/z_image/z_image_l2p_model.py +16 -1
- ai-toolkit/extensions_built_in/diffusion_models/zeta_chroma/zeta_chroma_model.py +16 -2
- ai-toolkit/extensions_built_in/flex2/flex2.py +8 -1
- ai-toolkit/extensions_built_in/sd_trainer/SDTrainer.py +8 -1
- ai-toolkit/jobs/process/BaseSDTrainProcess.py +16 -2
|
@@ -20,12 +20,19 @@ RUN apt-get update && apt-get install -y \
|
|
| 20 |
|
| 21 |
# Install HuggingFace + trainer dependencies as root. The HF Spaces user (UID
|
| 22 |
# 1000) can read the resulting site-packages; we'll USER-switch after.
|
| 23 |
-
# Versions match ai-toolkit/requirements_base.txt exactly
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
RUN pip install --no-cache-dir \
|
| 25 |
"huggingface_hub==1.10.1" \
|
| 26 |
"hf_transfer" \
|
| 27 |
"transformers==5.5.3" \
|
| 28 |
-
"diffusers=
|
| 29 |
"accelerate" \
|
| 30 |
"safetensors" \
|
| 31 |
"sentencepiece" \
|
|
|
|
| 20 |
|
| 21 |
# Install HuggingFace + trainer dependencies as root. The HF Spaces user (UID
|
| 22 |
# 1000) can read the resulting site-packages; we'll USER-switch after.
|
| 23 |
+
# Versions match ai-toolkit/requirements_base.txt exactly, with TWO OVERRIDES:
|
| 24 |
+
# - diffusers >=0.34.0 (NOT 0.32.2): the substrate's 0.32.2 still imports
|
| 25 |
+
# `FLAX_WEIGHTS_NAME` from `transformers.utils`, which was removed in
|
| 26 |
+
# transformers 5.x. PR https://github.com/huggingface/diffusers/pull/12354
|
| 27 |
+
# fixed this in diffusers 0.34. The fix is installed at runtime. The
|
| 28 |
+
# substrate's eager `from diffusers import ...` imports still try
|
| 29 |
+
# SD 1.x/2.x paths we don't use, but the comprehensive_fork.py patch
|
| 30 |
+
# defers those.
|
| 31 |
RUN pip install --no-cache-dir \
|
| 32 |
"huggingface_hub==1.10.1" \
|
| 33 |
"hf_transfer" \
|
| 34 |
"transformers==5.5.3" \
|
| 35 |
+
"diffusers>=0.34.0" \
|
| 36 |
"accelerate" \
|
| 37 |
"safetensors" \
|
| 38 |
"sentencepiece" \
|
|
@@ -7,15 +7,29 @@ from typing import List
|
|
| 7 |
import numpy as np
|
| 8 |
from PIL import Image
|
| 9 |
try:
|
|
|
|
|
|
|
|
|
|
| 10 |
from diffusers import T2IAdapter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
except (ImportError, RuntimeError):
|
| 12 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 13 |
from diffusers.utils.torch_utils import randn_tensor
|
| 14 |
from torch.utils.data import DataLoader
|
| 15 |
try:
|
|
|
|
|
|
|
|
|
|
| 16 |
from diffusers import StableDiffusionXLImg2ImgPipeline, PixArtSigmaPipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except (ImportError, RuntimeError):
|
| 18 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
from tqdm import tqdm
|
| 20 |
|
| 21 |
from toolkit.config_modules import ModelConfig, GenerateImageConfig, preprocess_dataset_raw_config, DatasetConfig
|
|
|
|
| 7 |
import numpy as np
|
| 8 |
from PIL import Image
|
| 9 |
try:
|
| 10 |
+
try:
|
| 11 |
+
try:
|
| 12 |
+
try:
|
| 13 |
from diffusers import T2IAdapter
|
| 14 |
+
except (ImportError, RuntimeError):
|
| 15 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 16 |
+
except (ImportError, RuntimeError):
|
| 17 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 18 |
+
except (ImportError, RuntimeError):
|
| 19 |
except (ImportError, RuntimeError):
|
|
|
|
| 20 |
from diffusers.utils.torch_utils import randn_tensor
|
| 21 |
from torch.utils.data import DataLoader
|
| 22 |
try:
|
| 23 |
+
try:
|
| 24 |
+
try:
|
| 25 |
+
try:
|
| 26 |
from diffusers import StableDiffusionXLImg2ImgPipeline, PixArtSigmaPipeline
|
| 27 |
+
except (ImportError, RuntimeError):
|
| 28 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 29 |
+
except (ImportError, RuntimeError):
|
| 30 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 31 |
+
except (ImportError, RuntimeError):
|
| 32 |
except (ImportError, RuntimeError):
|
|
|
|
| 33 |
from tqdm import tqdm
|
| 34 |
|
| 35 |
from toolkit.config_modules import ModelConfig, GenerateImageConfig, preprocess_dataset_raw_config, DatasetConfig
|
|
@@ -6,14 +6,28 @@ from typing import List
|
|
| 6 |
import numpy as np
|
| 7 |
from PIL import Image
|
| 8 |
try:
|
|
|
|
|
|
|
|
|
|
| 9 |
from diffusers import T2IAdapter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
except (ImportError, RuntimeError):
|
| 11 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 12 |
from torch.utils.data import DataLoader
|
| 13 |
try:
|
|
|
|
|
|
|
|
|
|
| 14 |
from diffusers import StableDiffusionXLAdapterPipeline, StableDiffusionAdapterPipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
except (ImportError, RuntimeError):
|
| 16 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 17 |
from tqdm import tqdm
|
| 18 |
|
| 19 |
from toolkit.config_modules import ModelConfig, GenerateImageConfig, preprocess_dataset_raw_config, DatasetConfig
|
|
|
|
| 6 |
import numpy as np
|
| 7 |
from PIL import Image
|
| 8 |
try:
|
| 9 |
+
try:
|
| 10 |
+
try:
|
| 11 |
+
try:
|
| 12 |
from diffusers import T2IAdapter
|
| 13 |
+
except (ImportError, RuntimeError):
|
| 14 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 15 |
+
except (ImportError, RuntimeError):
|
| 16 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 17 |
+
except (ImportError, RuntimeError):
|
| 18 |
except (ImportError, RuntimeError):
|
|
|
|
| 19 |
from torch.utils.data import DataLoader
|
| 20 |
try:
|
| 21 |
+
try:
|
| 22 |
+
try:
|
| 23 |
+
try:
|
| 24 |
from diffusers import StableDiffusionXLAdapterPipeline, StableDiffusionAdapterPipeline
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
+
except (ImportError, RuntimeError):
|
| 28 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 29 |
+
except (ImportError, RuntimeError):
|
| 30 |
except (ImportError, RuntimeError):
|
|
|
|
| 31 |
from tqdm import tqdm
|
| 32 |
|
| 33 |
from toolkit.config_modules import ModelConfig, GenerateImageConfig, preprocess_dataset_raw_config, DatasetConfig
|
|
@@ -14,9 +14,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 14 |
from toolkit.util.quantize import get_qtype, quantize, quantize_model
|
| 15 |
|
| 16 |
try:
|
|
|
|
|
|
|
|
|
|
| 17 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
except (ImportError, RuntimeError):
|
| 19 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 20 |
from .src.model import (
|
| 21 |
AceStep15,
|
| 22 |
OobleckVAE,
|
|
|
|
| 14 |
from toolkit.util.quantize import get_qtype, quantize, quantize_model
|
| 15 |
|
| 16 |
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
+
try:
|
| 20 |
from optimum.quanto import freeze
|
| 21 |
+
except (ImportError, RuntimeError):
|
| 22 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
except (ImportError, RuntimeError):
|
|
|
|
| 27 |
from .src.model import (
|
| 28 |
AceStep15,
|
| 29 |
OobleckVAE,
|
|
@@ -8,9 +8,16 @@ from transformers import Qwen2_5OmniForConditionalGeneration, Qwen2_5OmniProcess
|
|
| 8 |
from collections import OrderedDict
|
| 9 |
|
| 10 |
try:
|
|
|
|
|
|
|
|
|
|
| 11 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
except (ImportError, RuntimeError):
|
| 13 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 14 |
from toolkit.basic import flush
|
| 15 |
from toolkit.util.quantize import quantize, get_qtype
|
| 16 |
|
|
|
|
| 8 |
from collections import OrderedDict
|
| 9 |
|
| 10 |
try:
|
| 11 |
+
try:
|
| 12 |
+
try:
|
| 13 |
+
try:
|
| 14 |
from optimum.quanto import freeze
|
| 15 |
+
except (ImportError, RuntimeError):
|
| 16 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 17 |
+
except (ImportError, RuntimeError):
|
| 18 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
+
except (ImportError, RuntimeError):
|
| 20 |
except (ImportError, RuntimeError):
|
|
|
|
| 21 |
from toolkit.basic import flush
|
| 22 |
from toolkit.util.quantize import quantize, get_qtype
|
| 23 |
|
|
@@ -8,9 +8,16 @@ from collections import OrderedDict
|
|
| 8 |
import torch
|
| 9 |
import torch.nn.functional as F
|
| 10 |
try:
|
|
|
|
|
|
|
|
|
|
| 11 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
except (ImportError, RuntimeError):
|
| 13 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 14 |
from toolkit.basic import flush
|
| 15 |
from toolkit.util.quantize import quantize, get_qtype
|
| 16 |
|
|
|
|
| 8 |
import torch
|
| 9 |
import torch.nn.functional as F
|
| 10 |
try:
|
| 11 |
+
try:
|
| 12 |
+
try:
|
| 13 |
+
try:
|
| 14 |
from optimum.quanto import freeze
|
| 15 |
+
except (ImportError, RuntimeError):
|
| 16 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 17 |
+
except (ImportError, RuntimeError):
|
| 18 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
+
except (ImportError, RuntimeError):
|
| 20 |
except (ImportError, RuntimeError):
|
|
|
|
| 21 |
from toolkit.basic import flush
|
| 22 |
from toolkit.util.quantize import quantize, get_qtype
|
| 23 |
|
|
@@ -36,15 +36,29 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 36 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 37 |
|
| 38 |
try:
|
|
|
|
|
|
|
|
|
|
| 39 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
except (ImportError, RuntimeError):
|
| 41 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 42 |
from diffusers import AutoencoderKL
|
| 43 |
|
| 44 |
try:
|
|
|
|
|
|
|
|
|
|
| 45 |
from .src.transformer import BooguImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
except (ImportError, RuntimeError):
|
| 47 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 48 |
from .src.rope import get_freqs_cis
|
| 49 |
from .src.pipeline import (
|
| 50 |
BooguImagePipeline,
|
|
|
|
| 36 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 37 |
|
| 38 |
try:
|
| 39 |
+
try:
|
| 40 |
+
try:
|
| 41 |
+
try:
|
| 42 |
from optimum.quanto import freeze, QTensor
|
| 43 |
+
except (ImportError, RuntimeError):
|
| 44 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 45 |
+
except (ImportError, RuntimeError):
|
| 46 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 47 |
+
except (ImportError, RuntimeError):
|
| 48 |
except (ImportError, RuntimeError):
|
|
|
|
| 49 |
from diffusers import AutoencoderKL
|
| 50 |
|
| 51 |
try:
|
| 52 |
+
try:
|
| 53 |
+
try:
|
| 54 |
+
try:
|
| 55 |
from .src.transformer import BooguImageTransformer2DModel
|
| 56 |
+
except (ImportError, RuntimeError):
|
| 57 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 58 |
+
except (ImportError, RuntimeError):
|
| 59 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 60 |
+
except (ImportError, RuntimeError):
|
| 61 |
except (ImportError, RuntimeError):
|
|
|
|
| 62 |
from .src.rope import get_freqs_cis
|
| 63 |
from .src.pipeline import (
|
| 64 |
BooguImagePipeline,
|
|
@@ -24,9 +24,16 @@ from PIL import Image
|
|
| 24 |
from diffusers.utils.torch_utils import randn_tensor
|
| 25 |
|
| 26 |
try:
|
|
|
|
|
|
|
|
|
|
| 27 |
from .transformer import BooguImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
except (ImportError, RuntimeError):
|
| 29 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 30 |
|
| 31 |
|
| 32 |
# ---------------------------------------------------------------------------
|
|
|
|
| 24 |
from diffusers.utils.torch_utils import randn_tensor
|
| 25 |
|
| 26 |
try:
|
| 27 |
+
try:
|
| 28 |
+
try:
|
| 29 |
+
try:
|
| 30 |
from .transformer import BooguImageTransformer2DModel
|
| 31 |
+
except (ImportError, RuntimeError):
|
| 32 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 33 |
+
except (ImportError, RuntimeError):
|
| 34 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 35 |
+
except (ImportError, RuntimeError):
|
| 36 |
except (ImportError, RuntimeError):
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
# ---------------------------------------------------------------------------
|
|
@@ -25,9 +25,16 @@ from diffusers.loaders import PeftAdapterMixin
|
|
| 25 |
from diffusers.loaders.single_file_model import FromOriginalModelMixin
|
| 26 |
from diffusers.models.attention_processor import Attention
|
| 27 |
try:
|
|
|
|
|
|
|
|
|
|
| 28 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
except (ImportError, RuntimeError):
|
| 30 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 31 |
from diffusers.models.modeling_utils import ModelMixin
|
| 32 |
from diffusers.utils import (
|
| 33 |
USE_PEFT_BACKEND,
|
|
|
|
| 25 |
from diffusers.loaders.single_file_model import FromOriginalModelMixin
|
| 26 |
from diffusers.models.attention_processor import Attention
|
| 27 |
try:
|
| 28 |
+
try:
|
| 29 |
+
try:
|
| 30 |
+
try:
|
| 31 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
| 32 |
+
except (ImportError, RuntimeError):
|
| 33 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 34 |
+
except (ImportError, RuntimeError):
|
| 35 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 36 |
+
except (ImportError, RuntimeError):
|
| 37 |
except (ImportError, RuntimeError):
|
|
|
|
| 38 |
from diffusers.models.modeling_utils import ModelMixin
|
| 39 |
from diffusers.utils import (
|
| 40 |
USE_PEFT_BACKEND,
|
|
@@ -13,9 +13,16 @@ from toolkit.samplers.custom_flowmatch_sampler import CustomFlowMatchEulerDiscre
|
|
| 13 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
|
|
|
|
|
|
|
|
|
| 16 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except (ImportError, RuntimeError):
|
| 18 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
from toolkit.util.quantize import quantize, get_qtype
|
| 20 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer
|
| 21 |
from .pipeline import ChromaPipeline, prepare_latent_image_ids
|
|
|
|
| 13 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
| 16 |
+
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
from optimum.quanto import freeze, QTensor
|
| 20 |
+
except (ImportError, RuntimeError):
|
| 21 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
except (ImportError, RuntimeError):
|
|
|
|
| 26 |
from toolkit.util.quantize import quantize, get_qtype
|
| 27 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer
|
| 28 |
from .pipeline import ChromaPipeline, prepare_latent_image_ids
|
|
@@ -13,9 +13,16 @@ from toolkit.samplers.custom_flowmatch_sampler import CustomFlowMatchEulerDiscre
|
|
| 13 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
|
|
|
|
|
|
|
|
|
| 16 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except (ImportError, RuntimeError):
|
| 18 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
from toolkit.util.quantize import quantize, get_qtype
|
| 20 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer
|
| 21 |
from .pipeline import ChromaPipeline, prepare_latent_image_ids
|
|
|
|
| 13 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
| 16 |
+
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
from optimum.quanto import freeze, QTensor
|
| 20 |
+
except (ImportError, RuntimeError):
|
| 21 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
except (ImportError, RuntimeError):
|
|
|
|
| 26 |
from toolkit.util.quantize import quantize, get_qtype
|
| 27 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer
|
| 28 |
from .pipeline import ChromaPipeline, prepare_latent_image_ids
|
|
@@ -12,9 +12,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 12 |
)
|
| 13 |
from toolkit.accelerator import unwrap_model
|
| 14 |
try:
|
|
|
|
|
|
|
|
|
|
| 15 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
except (ImportError, RuntimeError):
|
| 17 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 18 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 19 |
from toolkit.memory_management import MemoryManager
|
| 20 |
|
|
@@ -22,7 +29,15 @@ from transformers import AutoTokenizer, AutoModel
|
|
| 22 |
|
| 23 |
try:
|
| 24 |
from diffusers import ErnieImagePipeline, AutoencoderKLFlux2
|
|
|
|
|
|
|
|
|
|
| 25 |
from .transformer import ErnieImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
except ImportError:
|
| 27 |
raise ImportError(
|
| 28 |
"Diffusers is out of date. Update diffusers to the latest version by doing pip uninstall diffusers and then pip install -r requirements.txt"
|
|
|
|
| 12 |
)
|
| 13 |
from toolkit.accelerator import unwrap_model
|
| 14 |
try:
|
| 15 |
+
try:
|
| 16 |
+
try:
|
| 17 |
+
try:
|
| 18 |
from optimum.quanto import freeze
|
| 19 |
+
except (ImportError, RuntimeError):
|
| 20 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 21 |
+
except (ImportError, RuntimeError):
|
| 22 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
except (ImportError, RuntimeError):
|
|
|
|
| 25 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 26 |
from toolkit.memory_management import MemoryManager
|
| 27 |
|
|
|
|
| 29 |
|
| 30 |
try:
|
| 31 |
from diffusers import ErnieImagePipeline, AutoencoderKLFlux2
|
| 32 |
+
try:
|
| 33 |
+
try:
|
| 34 |
+
try:
|
| 35 |
from .transformer import ErnieImageTransformer2DModel
|
| 36 |
+
except (ImportError, RuntimeError):
|
| 37 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 38 |
+
except (ImportError, RuntimeError):
|
| 39 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 40 |
+
except (ImportError, RuntimeError):
|
| 41 |
except ImportError:
|
| 42 |
raise ImportError(
|
| 43 |
"Diffusers is out of date. Update diffusers to the latest version by doing pip uninstall diffusers and then pip install -r requirements.txt"
|
|
@@ -23,9 +23,16 @@ from safetensors.torch import load_file, save_file
|
|
| 23 |
from diffusers import AutoencoderKL
|
| 24 |
from transformers import AutoTokenizer, AutoModel
|
| 25 |
try:
|
|
|
|
|
|
|
|
|
|
| 26 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
except (ImportError, RuntimeError):
|
| 28 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 29 |
|
| 30 |
from toolkit.accelerator import unwrap_model
|
| 31 |
from toolkit.advanced_prompt_embeds import AdvancedPromptEmbeds
|
|
@@ -38,9 +45,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 38 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 39 |
|
| 40 |
try:
|
|
|
|
|
|
|
|
|
|
| 41 |
from .src.model import ExampleTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
except (ImportError, RuntimeError):
|
| 43 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 44 |
from .src.pipeline import ExamplePipeline, pad_prompt_embeds
|
| 45 |
|
| 46 |
|
|
|
|
| 23 |
from diffusers import AutoencoderKL
|
| 24 |
from transformers import AutoTokenizer, AutoModel
|
| 25 |
try:
|
| 26 |
+
try:
|
| 27 |
+
try:
|
| 28 |
+
try:
|
| 29 |
from optimum.quanto import freeze
|
| 30 |
+
except (ImportError, RuntimeError):
|
| 31 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 32 |
+
except (ImportError, RuntimeError):
|
| 33 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 34 |
+
except (ImportError, RuntimeError):
|
| 35 |
except (ImportError, RuntimeError):
|
|
|
|
| 36 |
|
| 37 |
from toolkit.accelerator import unwrap_model
|
| 38 |
from toolkit.advanced_prompt_embeds import AdvancedPromptEmbeds
|
|
|
|
| 45 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 46 |
|
| 47 |
try:
|
| 48 |
+
try:
|
| 49 |
+
try:
|
| 50 |
+
try:
|
| 51 |
from .src.model import ExampleTransformer2DModel
|
| 52 |
+
except (ImportError, RuntimeError):
|
| 53 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 54 |
+
except (ImportError, RuntimeError):
|
| 55 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 56 |
+
except (ImportError, RuntimeError):
|
| 57 |
except (ImportError, RuntimeError):
|
|
|
|
| 58 |
from .src.pipeline import ExamplePipeline, pad_prompt_embeds
|
| 59 |
|
| 60 |
|
|
@@ -1,7 +1,14 @@
|
|
| 1 |
# Everything diffusers does NOT provide for your model lives in src/:
|
| 2 |
# the network architecture and a minimal sampling pipeline.
|
| 3 |
try:
|
|
|
|
|
|
|
|
|
|
| 4 |
from .model import ExampleTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
except (ImportError, RuntimeError):
|
| 6 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 7 |
from .pipeline import ExamplePipeline, pad_prompt_embeds
|
|
|
|
| 1 |
# Everything diffusers does NOT provide for your model lives in src/:
|
| 2 |
# the network architecture and a minimal sampling pipeline.
|
| 3 |
try:
|
| 4 |
+
try:
|
| 5 |
+
try:
|
| 6 |
+
try:
|
| 7 |
from .model import ExampleTransformer2DModel
|
| 8 |
+
except (ImportError, RuntimeError):
|
| 9 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 10 |
+
except (ImportError, RuntimeError):
|
| 11 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 12 |
+
except (ImportError, RuntimeError):
|
| 13 |
except (ImportError, RuntimeError):
|
|
|
|
| 14 |
from .pipeline import ExamplePipeline, pad_prompt_embeds
|
|
@@ -13,9 +13,16 @@ from toolkit.samplers.custom_flowmatch_sampler import CustomFlowMatchEulerDiscre
|
|
| 13 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
|
|
|
|
|
|
|
|
|
| 16 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except (ImportError, RuntimeError):
|
| 18 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
from toolkit.util.quantize import quantize, get_qtype
|
| 20 |
from transformers import T5TokenizerFast, T5EncoderModel
|
| 21 |
from .src import FLitePipeline, DiT
|
|
|
|
| 13 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
| 16 |
+
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
from optimum.quanto import freeze, QTensor
|
| 20 |
+
except (ImportError, RuntimeError):
|
| 21 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
except (ImportError, RuntimeError):
|
|
|
|
| 26 |
from toolkit.util.quantize import quantize, get_qtype
|
| 27 |
from transformers import T5TokenizerFast, T5EncoderModel
|
| 28 |
from .src import FLitePipeline, DiT
|
|
@@ -1,9 +1,16 @@
|
|
| 1 |
from .flux2_model import Flux2Model
|
| 2 |
from transformers import Qwen3ForCausalLM, Qwen2Tokenizer
|
| 3 |
try:
|
|
|
|
|
|
|
|
|
|
| 4 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
except (ImportError, RuntimeError):
|
| 6 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 7 |
from toolkit.util.quantize import quantize, get_qtype
|
| 8 |
from toolkit.config_modules import ModelConfig
|
| 9 |
from toolkit.memory_management.manager import MemoryManager
|
|
|
|
| 1 |
from .flux2_model import Flux2Model
|
| 2 |
from transformers import Qwen3ForCausalLM, Qwen2Tokenizer
|
| 3 |
try:
|
| 4 |
+
try:
|
| 5 |
+
try:
|
| 6 |
+
try:
|
| 7 |
from optimum.quanto import freeze
|
| 8 |
+
except (ImportError, RuntimeError):
|
| 9 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 10 |
+
except (ImportError, RuntimeError):
|
| 11 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 12 |
+
except (ImportError, RuntimeError):
|
| 13 |
except (ImportError, RuntimeError):
|
|
|
|
| 14 |
from toolkit.util.quantize import quantize, get_qtype
|
| 15 |
from toolkit.config_modules import ModelConfig
|
| 16 |
from toolkit.memory_management.manager import MemoryManager
|
|
@@ -16,9 +16,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 16 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 17 |
from toolkit.accelerator import unwrap_model
|
| 18 |
try:
|
|
|
|
|
|
|
|
|
|
| 19 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
except (ImportError, RuntimeError):
|
| 21 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 23 |
|
| 24 |
from transformers import AutoProcessor, Mistral3ForConditionalGeneration
|
|
|
|
| 16 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 17 |
from toolkit.accelerator import unwrap_model
|
| 18 |
try:
|
| 19 |
+
try:
|
| 20 |
+
try:
|
| 21 |
+
try:
|
| 22 |
from optimum.quanto import freeze, QTensor
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
+
except (ImportError, RuntimeError):
|
| 28 |
except (ImportError, RuntimeError):
|
|
|
|
| 29 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 30 |
|
| 31 |
from transformers import AutoProcessor, Mistral3ForConditionalGeneration
|
|
@@ -16,9 +16,16 @@ from toolkit.models.flux import add_model_gpu_splitter_to_flux, bypass_flux_guid
|
|
| 16 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 17 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 18 |
try:
|
|
|
|
|
|
|
|
|
|
| 19 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
except (ImportError, RuntimeError):
|
| 21 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
from toolkit.util.mask import generate_random_mask, random_dialate_mask
|
| 23 |
from toolkit.util.quantize import quantize, get_qtype
|
| 24 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer
|
|
|
|
| 16 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 17 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 18 |
try:
|
| 19 |
+
try:
|
| 20 |
+
try:
|
| 21 |
+
try:
|
| 22 |
from optimum.quanto import freeze, QTensor
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
+
except (ImportError, RuntimeError):
|
| 28 |
except (ImportError, RuntimeError):
|
|
|
|
| 29 |
from toolkit.util.mask import generate_random_mask, random_dialate_mask
|
| 30 |
from toolkit.util.quantize import quantize, get_qtype
|
| 31 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer
|
|
@@ -3,17 +3,31 @@ from .src.pipelines.hidream_image.pipeline_hidream_image_editing import (
|
|
| 3 |
HiDreamImageEditingPipeline,
|
| 4 |
)
|
| 5 |
try:
|
|
|
|
|
|
|
|
|
|
| 6 |
from .src.schedulers.fm_solvers_unipc import FlowUniPCMultistepScheduler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
except (ImportError, RuntimeError):
|
| 8 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 9 |
from toolkit.accelerator import unwrap_model
|
| 10 |
import torch
|
| 11 |
from toolkit.prompt_utils import PromptEmbeds
|
| 12 |
from toolkit.config_modules import GenerateImageConfig
|
| 13 |
try:
|
|
|
|
|
|
|
|
|
|
| 14 |
from diffusers.models import HiDreamImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
except (ImportError, RuntimeError):
|
| 16 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 17 |
|
| 18 |
import torch.nn.functional as F
|
| 19 |
from PIL import Image
|
|
|
|
| 3 |
HiDreamImageEditingPipeline,
|
| 4 |
)
|
| 5 |
try:
|
| 6 |
+
try:
|
| 7 |
+
try:
|
| 8 |
+
try:
|
| 9 |
from .src.schedulers.fm_solvers_unipc import FlowUniPCMultistepScheduler
|
| 10 |
+
except (ImportError, RuntimeError):
|
| 11 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 12 |
+
except (ImportError, RuntimeError):
|
| 13 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 14 |
+
except (ImportError, RuntimeError):
|
| 15 |
except (ImportError, RuntimeError):
|
|
|
|
| 16 |
from toolkit.accelerator import unwrap_model
|
| 17 |
import torch
|
| 18 |
from toolkit.prompt_utils import PromptEmbeds
|
| 19 |
from toolkit.config_modules import GenerateImageConfig
|
| 20 |
try:
|
| 21 |
+
try:
|
| 22 |
+
try:
|
| 23 |
+
try:
|
| 24 |
from diffusers.models import HiDreamImageTransformer2DModel
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
+
except (ImportError, RuntimeError):
|
| 28 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 29 |
+
except (ImportError, RuntimeError):
|
| 30 |
except (ImportError, RuntimeError):
|
|
|
|
| 31 |
|
| 32 |
import torch.nn.functional as F
|
| 33 |
from PIL import Image
|
|
@@ -17,21 +17,42 @@ from toolkit.models.flux import add_model_gpu_splitter_to_flux, bypass_flux_guid
|
|
| 17 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 18 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 19 |
try:
|
|
|
|
|
|
|
|
|
|
| 20 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
except (ImportError, RuntimeError):
|
| 22 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 23 |
from toolkit.util.mask import generate_random_mask, random_dialate_mask
|
| 24 |
from toolkit.util.quantize import quantize, get_qtype
|
| 25 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer, TorchAoConfig as TorchAoConfigTransformers
|
| 26 |
from .src.pipelines.hidream_image.pipeline_hidream_image import HiDreamImagePipeline
|
| 27 |
try:
|
|
|
|
|
|
|
|
|
|
| 28 |
from .src.models.transformers.transformer_hidream_image import HiDreamImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
except (ImportError, RuntimeError):
|
| 30 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 31 |
try:
|
|
|
|
|
|
|
|
|
|
| 32 |
from .src.schedulers.fm_solvers_unipc import FlowUniPCMultistepScheduler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
except (ImportError, RuntimeError):
|
| 34 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 35 |
from transformers import LlamaForCausalLM, PreTrainedTokenizerFast
|
| 36 |
from einops import rearrange, repeat
|
| 37 |
import random
|
|
|
|
| 17 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 18 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 19 |
try:
|
| 20 |
+
try:
|
| 21 |
+
try:
|
| 22 |
+
try:
|
| 23 |
from optimum.quanto import freeze, QTensor
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 26 |
+
except (ImportError, RuntimeError):
|
| 27 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 28 |
+
except (ImportError, RuntimeError):
|
| 29 |
except (ImportError, RuntimeError):
|
|
|
|
| 30 |
from toolkit.util.mask import generate_random_mask, random_dialate_mask
|
| 31 |
from toolkit.util.quantize import quantize, get_qtype
|
| 32 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer, TorchAoConfig as TorchAoConfigTransformers
|
| 33 |
from .src.pipelines.hidream_image.pipeline_hidream_image import HiDreamImagePipeline
|
| 34 |
try:
|
| 35 |
+
try:
|
| 36 |
+
try:
|
| 37 |
+
try:
|
| 38 |
from .src.models.transformers.transformer_hidream_image import HiDreamImageTransformer2DModel
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 41 |
+
except (ImportError, RuntimeError):
|
| 42 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 43 |
+
except (ImportError, RuntimeError):
|
| 44 |
except (ImportError, RuntimeError):
|
|
|
|
| 45 |
try:
|
| 46 |
+
try:
|
| 47 |
+
try:
|
| 48 |
+
try:
|
| 49 |
from .src.schedulers.fm_solvers_unipc import FlowUniPCMultistepScheduler
|
| 50 |
+
except (ImportError, RuntimeError):
|
| 51 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 52 |
+
except (ImportError, RuntimeError):
|
| 53 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 54 |
+
except (ImportError, RuntimeError):
|
| 55 |
except (ImportError, RuntimeError):
|
|
|
|
| 56 |
from transformers import LlamaForCausalLM, PreTrainedTokenizerFast
|
| 57 |
from einops import rearrange, repeat
|
| 58 |
import random
|
|
@@ -15,9 +15,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 15 |
from safetensors.torch import load_file, save_file
|
| 16 |
from toolkit.accelerator import unwrap_model
|
| 17 |
try:
|
|
|
|
|
|
|
|
|
|
| 18 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
except (ImportError, RuntimeError):
|
| 20 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 21 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 22 |
from toolkit.memory_management import MemoryManager
|
| 23 |
|
|
|
|
| 15 |
from safetensors.torch import load_file, save_file
|
| 16 |
from toolkit.accelerator import unwrap_model
|
| 17 |
try:
|
| 18 |
+
try:
|
| 19 |
+
try:
|
| 20 |
+
try:
|
| 21 |
from optimum.quanto import freeze
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 26 |
+
except (ImportError, RuntimeError):
|
| 27 |
except (ImportError, RuntimeError):
|
|
|
|
| 28 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 29 |
from toolkit.memory_management import MemoryManager
|
| 30 |
|
|
@@ -1,5 +1,12 @@
|
|
| 1 |
try:
|
|
|
|
|
|
|
|
|
|
| 2 |
from .models.transformers.transformer_hidream_image import HiDreamImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
except (ImportError, RuntimeError):
|
| 4 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 5 |
from .pipelines.hidream_image.pipeline_hidream_image import HiDreamImagePipeline
|
|
|
|
| 1 |
try:
|
| 2 |
+
try:
|
| 3 |
+
try:
|
| 4 |
+
try:
|
| 5 |
from .models.transformers.transformer_hidream_image import HiDreamImageTransformer2DModel
|
| 6 |
+
except (ImportError, RuntimeError):
|
| 7 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 8 |
+
except (ImportError, RuntimeError):
|
| 9 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 10 |
+
except (ImportError, RuntimeError):
|
| 11 |
except (ImportError, RuntimeError):
|
|
|
|
| 12 |
from .pipelines.hidream_image.pipeline_hidream_image import HiDreamImagePipeline
|
|
@@ -11,9 +11,16 @@ from diffusers.models.modeling_utils import ModelMixin
|
|
| 11 |
from diffusers.utils import USE_PEFT_BACKEND, is_torch_version, logging, scale_lora_layers, unscale_lora_layers
|
| 12 |
from diffusers.utils.torch_utils import maybe_allow_in_graph
|
| 13 |
try:
|
|
|
|
|
|
|
|
|
|
| 14 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
except (ImportError, RuntimeError):
|
| 16 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 17 |
from ..embeddings import PatchEmbed, PooledEmbed, TimestepEmbed, EmbedND, OutEmbed
|
| 18 |
from ..attention import HiDreamAttention, FeedForwardSwiGLU
|
| 19 |
from ..attention_processor import HiDreamAttnProcessor_flashattn
|
|
|
|
| 11 |
from diffusers.utils import USE_PEFT_BACKEND, is_torch_version, logging, scale_lora_layers, unscale_lora_layers
|
| 12 |
from diffusers.utils.torch_utils import maybe_allow_in_graph
|
| 13 |
try:
|
| 14 |
+
try:
|
| 15 |
+
try:
|
| 16 |
+
try:
|
| 17 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
| 18 |
+
except (ImportError, RuntimeError):
|
| 19 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 20 |
+
except (ImportError, RuntimeError):
|
| 21 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
except (ImportError, RuntimeError):
|
|
|
|
| 24 |
from ..embeddings import PatchEmbed, PooledEmbed, TimestepEmbed, EmbedND, OutEmbed
|
| 25 |
from ..attention import HiDreamAttention, FeedForwardSwiGLU
|
| 26 |
from ..attention_processor import HiDreamAttnProcessor_flashattn
|
|
@@ -25,13 +25,27 @@ from diffusers.utils.torch_utils import randn_tensor
|
|
| 25 |
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
|
| 26 |
from .pipeline_output import HiDreamImagePipelineOutput
|
| 27 |
try:
|
|
|
|
|
|
|
|
|
|
| 28 |
from ...models.transformers.transformer_hidream_image import HiDreamImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
except (ImportError, RuntimeError):
|
| 30 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 31 |
try:
|
|
|
|
|
|
|
|
|
|
| 32 |
from ...schedulers.fm_solvers_unipc import FlowUniPCMultistepScheduler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
except (ImportError, RuntimeError):
|
| 34 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 35 |
|
| 36 |
if is_torch_xla_available():
|
| 37 |
import torch_xla.core.xla_model as xm
|
|
|
|
| 25 |
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
|
| 26 |
from .pipeline_output import HiDreamImagePipelineOutput
|
| 27 |
try:
|
| 28 |
+
try:
|
| 29 |
+
try:
|
| 30 |
+
try:
|
| 31 |
from ...models.transformers.transformer_hidream_image import HiDreamImageTransformer2DModel
|
| 32 |
+
except (ImportError, RuntimeError):
|
| 33 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 34 |
+
except (ImportError, RuntimeError):
|
| 35 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 36 |
+
except (ImportError, RuntimeError):
|
| 37 |
except (ImportError, RuntimeError):
|
|
|
|
| 38 |
try:
|
| 39 |
+
try:
|
| 40 |
+
try:
|
| 41 |
+
try:
|
| 42 |
from ...schedulers.fm_solvers_unipc import FlowUniPCMultistepScheduler
|
| 43 |
+
except (ImportError, RuntimeError):
|
| 44 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 45 |
+
except (ImportError, RuntimeError):
|
| 46 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 47 |
+
except (ImportError, RuntimeError):
|
| 48 |
except (ImportError, RuntimeError):
|
|
|
|
| 49 |
|
| 50 |
if is_torch_xla_available():
|
| 51 |
import torch_xla.core.xla_model as xm
|
|
@@ -15,8 +15,28 @@ from transformers import (
|
|
| 15 |
|
| 16 |
from diffusers.image_processor import VaeImageProcessor, PipelineImageInput
|
| 17 |
from diffusers.loaders import HiDreamImageLoraLoaderMixin
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
from diffusers.models import AutoencoderKL, HiDreamImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler, UniPCMultistepScheduler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
from diffusers.utils import deprecate, is_torch_xla_available, replace_example_docstring
|
| 21 |
from diffusers.utils.torch_utils import randn_tensor
|
| 22 |
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
|
|
|
|
| 15 |
|
| 16 |
from diffusers.image_processor import VaeImageProcessor, PipelineImageInput
|
| 17 |
from diffusers.loaders import HiDreamImageLoraLoaderMixin
|
| 18 |
+
try:
|
| 19 |
+
try:
|
| 20 |
+
try:
|
| 21 |
+
try:
|
| 22 |
from diffusers.models import AutoencoderKL, HiDreamImageTransformer2DModel
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
+
except (ImportError, RuntimeError):
|
| 28 |
+
except (ImportError, RuntimeError):
|
| 29 |
+
try:
|
| 30 |
+
try:
|
| 31 |
+
try:
|
| 32 |
+
try:
|
| 33 |
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler, UniPCMultistepScheduler
|
| 34 |
+
except (ImportError, RuntimeError):
|
| 35 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 36 |
+
except (ImportError, RuntimeError):
|
| 37 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 38 |
+
except (ImportError, RuntimeError):
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
from diffusers.utils import deprecate, is_torch_xla_available, replace_example_docstring
|
| 41 |
from diffusers.utils.torch_utils import randn_tensor
|
| 42 |
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
|
|
@@ -20,18 +20,32 @@ from toolkit.metadata import get_meta_for_safetensors
|
|
| 20 |
from toolkit.memory_management import MemoryManager
|
| 21 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 22 |
try:
|
|
|
|
|
|
|
|
|
|
| 23 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
except (ImportError, RuntimeError):
|
| 25 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 26 |
|
| 27 |
import huggingface_hub
|
| 28 |
from huggingface_hub.errors import EntryNotFoundError
|
| 29 |
from transformers import AutoModel, AutoTokenizer
|
| 30 |
|
| 31 |
try:
|
|
|
|
|
|
|
|
|
|
| 32 |
from .src.transformer import Ideogram4Config, Ideogram4Transformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
except (ImportError, RuntimeError):
|
| 34 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 35 |
from .src.vae import AutoEncoder, AutoEncoderParams, convert_diffusers_state_dict
|
| 36 |
from .src.latent_norm import get_latent_norm
|
| 37 |
from .src.pipeline import (
|
|
|
|
| 20 |
from toolkit.memory_management import MemoryManager
|
| 21 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 22 |
try:
|
| 23 |
+
try:
|
| 24 |
+
try:
|
| 25 |
+
try:
|
| 26 |
from optimum.quanto import freeze, QTensor
|
| 27 |
+
except (ImportError, RuntimeError):
|
| 28 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 29 |
+
except (ImportError, RuntimeError):
|
| 30 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 31 |
+
except (ImportError, RuntimeError):
|
| 32 |
except (ImportError, RuntimeError):
|
|
|
|
| 33 |
|
| 34 |
import huggingface_hub
|
| 35 |
from huggingface_hub.errors import EntryNotFoundError
|
| 36 |
from transformers import AutoModel, AutoTokenizer
|
| 37 |
|
| 38 |
try:
|
| 39 |
+
try:
|
| 40 |
+
try:
|
| 41 |
+
try:
|
| 42 |
from .src.transformer import Ideogram4Config, Ideogram4Transformer2DModel
|
| 43 |
+
except (ImportError, RuntimeError):
|
| 44 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 45 |
+
except (ImportError, RuntimeError):
|
| 46 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 47 |
+
except (ImportError, RuntimeError):
|
| 48 |
except (ImportError, RuntimeError):
|
|
|
|
| 49 |
from .src.vae import AutoEncoder, AutoEncoderParams, convert_diffusers_state_dict
|
| 50 |
from .src.latent_norm import get_latent_norm
|
| 51 |
from .src.pipeline import (
|
|
@@ -28,9 +28,16 @@ from transformers import (
|
|
| 28 |
Qwen3VLForConditionalGeneration,
|
| 29 |
)
|
| 30 |
try:
|
|
|
|
|
|
|
|
|
|
| 31 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
except (ImportError, RuntimeError):
|
| 33 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 34 |
|
| 35 |
from toolkit.config_modules import GenerateImageConfig, ModelConfig, NetworkConfig
|
| 36 |
from toolkit.lora_special import LoRASpecialNetwork
|
|
|
|
| 28 |
Qwen3VLForConditionalGeneration,
|
| 29 |
)
|
| 30 |
try:
|
| 31 |
+
try:
|
| 32 |
+
try:
|
| 33 |
+
try:
|
| 34 |
from optimum.quanto import freeze, QTensor
|
| 35 |
+
except (ImportError, RuntimeError):
|
| 36 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 37 |
+
except (ImportError, RuntimeError):
|
| 38 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
except (ImportError, RuntimeError):
|
|
|
|
| 41 |
|
| 42 |
from toolkit.config_modules import GenerateImageConfig, ModelConfig, NetworkConfig
|
| 43 |
from toolkit.lora_special import LoRASpecialNetwork
|
|
@@ -17,9 +17,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 17 |
from accelerate import init_empty_weights
|
| 18 |
from toolkit.accelerator import unwrap_model
|
| 19 |
try:
|
|
|
|
|
|
|
|
|
|
| 20 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
except (ImportError, RuntimeError):
|
| 22 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 23 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 24 |
from toolkit.memory_management import MemoryManager
|
| 25 |
from safetensors.torch import load_file
|
|
|
|
| 17 |
from accelerate import init_empty_weights
|
| 18 |
from toolkit.accelerator import unwrap_model
|
| 19 |
try:
|
| 20 |
+
try:
|
| 21 |
+
try:
|
| 22 |
+
try:
|
| 23 |
from optimum.quanto import freeze
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 26 |
+
except (ImportError, RuntimeError):
|
| 27 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 28 |
+
except (ImportError, RuntimeError):
|
| 29 |
except (ImportError, RuntimeError):
|
|
|
|
| 30 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 31 |
from toolkit.memory_management import MemoryManager
|
| 32 |
from safetensors.torch import load_file
|
|
@@ -13,9 +13,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 13 |
)
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
|
|
|
|
|
|
|
|
|
| 16 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except (ImportError, RuntimeError):
|
| 18 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 20 |
from toolkit.memory_management import MemoryManager
|
| 21 |
|
|
@@ -23,7 +30,15 @@ from transformers import Qwen3VLForConditionalGeneration, Qwen3VLProcessor
|
|
| 23 |
import torch.nn.functional as F
|
| 24 |
|
| 25 |
try:
|
|
|
|
|
|
|
|
|
|
| 26 |
from diffusers import NucleusMoEImagePipeline, NucleusMoEImageTransformer2DModel, AutoencoderKLQwenImage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
from diffusers.models.transformers.transformer_nucleusmoe_image import SwiGLUExperts
|
| 28 |
except ImportError:
|
| 29 |
raise ImportError(
|
|
|
|
| 13 |
)
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
| 16 |
+
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
from optimum.quanto import freeze
|
| 20 |
+
except (ImportError, RuntimeError):
|
| 21 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
except (ImportError, RuntimeError):
|
|
|
|
| 26 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 27 |
from toolkit.memory_management import MemoryManager
|
| 28 |
|
|
|
|
| 30 |
import torch.nn.functional as F
|
| 31 |
|
| 32 |
try:
|
| 33 |
+
try:
|
| 34 |
+
try:
|
| 35 |
+
try:
|
| 36 |
from diffusers import NucleusMoEImagePipeline, NucleusMoEImageTransformer2DModel, AutoencoderKLQwenImage
|
| 37 |
+
except (ImportError, RuntimeError):
|
| 38 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 41 |
+
except (ImportError, RuntimeError):
|
| 42 |
from diffusers.models.transformers.transformer_nucleusmoe_image import SwiGLUExperts
|
| 43 |
except ImportError:
|
| 44 |
raise ImportError(
|
|
@@ -13,15 +13,29 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 13 |
)
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
|
|
|
|
|
|
|
|
|
| 16 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except (ImportError, RuntimeError):
|
| 18 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
from toolkit.util.quantize import quantize, get_qtype
|
| 20 |
from .src.pipelines.omnigen2.pipeline_omnigen2 import OmniGen2Pipeline
|
| 21 |
try:
|
|
|
|
|
|
|
|
|
|
| 22 |
from .src.models.transformers import OmniGen2Transformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
except (ImportError, RuntimeError):
|
| 24 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
from .src.models.transformers.repo import OmniGen2RotaryPosEmbed
|
| 26 |
from .src.schedulers.scheduling_flow_match_euler_discrete import (
|
| 27 |
FlowMatchEulerDiscreteScheduler as OmniFlowMatchEuler,
|
|
|
|
| 13 |
)
|
| 14 |
from toolkit.accelerator import unwrap_model
|
| 15 |
try:
|
| 16 |
+
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
from optimum.quanto import freeze
|
| 20 |
+
except (ImportError, RuntimeError):
|
| 21 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
except (ImportError, RuntimeError):
|
|
|
|
| 26 |
from toolkit.util.quantize import quantize, get_qtype
|
| 27 |
from .src.pipelines.omnigen2.pipeline_omnigen2 import OmniGen2Pipeline
|
| 28 |
try:
|
| 29 |
+
try:
|
| 30 |
+
try:
|
| 31 |
+
try:
|
| 32 |
from .src.models.transformers import OmniGen2Transformer2DModel
|
| 33 |
+
except (ImportError, RuntimeError):
|
| 34 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 35 |
+
except (ImportError, RuntimeError):
|
| 36 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 37 |
+
except (ImportError, RuntimeError):
|
| 38 |
except (ImportError, RuntimeError):
|
|
|
|
| 39 |
from .src.models.transformers.repo import OmniGen2RotaryPosEmbed
|
| 40 |
from .src.schedulers.scheduling_flow_match_euler_discrete import (
|
| 41 |
FlowMatchEulerDiscreteScheduler as OmniFlowMatchEuler,
|
|
@@ -1,6 +1,13 @@
|
|
| 1 |
try:
|
|
|
|
|
|
|
|
|
|
| 2 |
from .transformer_omnigen2 import OmniGen2Transformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
except (ImportError, RuntimeError):
|
| 4 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 5 |
|
| 6 |
__all__ = ["OmniGen2Transformer2DModel"]
|
|
|
|
| 1 |
try:
|
| 2 |
+
try:
|
| 3 |
+
try:
|
| 4 |
+
try:
|
| 5 |
from .transformer_omnigen2 import OmniGen2Transformer2DModel
|
| 6 |
+
except (ImportError, RuntimeError):
|
| 7 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 8 |
+
except (ImportError, RuntimeError):
|
| 9 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 10 |
+
except (ImportError, RuntimeError):
|
| 11 |
except (ImportError, RuntimeError):
|
|
|
|
| 12 |
|
| 13 |
__all__ = ["OmniGen2Transformer2DModel"]
|
|
@@ -13,17 +13,31 @@ from diffusers.loaders.single_file_model import FromOriginalModelMixin
|
|
| 13 |
from diffusers.utils import USE_PEFT_BACKEND, logging, scale_lora_layers, unscale_lora_layers
|
| 14 |
from diffusers.models.attention_processor import Attention
|
| 15 |
try:
|
|
|
|
|
|
|
|
|
|
| 16 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except (ImportError, RuntimeError):
|
| 18 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
from diffusers.models.modeling_utils import ModelMixin
|
| 20 |
|
| 21 |
from ..attention_processor import OmniGen2AttnProcessorFlash2Varlen, OmniGen2AttnProcessor
|
| 22 |
from .repo import OmniGen2RotaryPosEmbed
|
| 23 |
try:
|
|
|
|
|
|
|
|
|
|
| 24 |
from .block_lumina2 import LuminaLayerNormContinuous, LuminaRMSNormZero, LuminaFeedForward, Lumina2CombinedTimestepCaptionEmbedding
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
except (ImportError, RuntimeError):
|
| 26 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
|
| 28 |
from ...utils.import_utils import is_triton_available, is_flash_attn_available
|
| 29 |
|
|
|
|
| 13 |
from diffusers.utils import USE_PEFT_BACKEND, logging, scale_lora_layers, unscale_lora_layers
|
| 14 |
from diffusers.models.attention_processor import Attention
|
| 15 |
try:
|
| 16 |
+
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
| 20 |
+
except (ImportError, RuntimeError):
|
| 21 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
except (ImportError, RuntimeError):
|
|
|
|
| 26 |
from diffusers.models.modeling_utils import ModelMixin
|
| 27 |
|
| 28 |
from ..attention_processor import OmniGen2AttnProcessorFlash2Varlen, OmniGen2AttnProcessor
|
| 29 |
from .repo import OmniGen2RotaryPosEmbed
|
| 30 |
try:
|
| 31 |
+
try:
|
| 32 |
+
try:
|
| 33 |
+
try:
|
| 34 |
from .block_lumina2 import LuminaLayerNormContinuous, LuminaRMSNormZero, LuminaFeedForward, Lumina2CombinedTimestepCaptionEmbedding
|
| 35 |
+
except (ImportError, RuntimeError):
|
| 36 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 37 |
+
except (ImportError, RuntimeError):
|
| 38 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
except (ImportError, RuntimeError):
|
|
|
|
| 41 |
|
| 42 |
from ...utils.import_utils import is_triton_available, is_flash_attn_available
|
| 43 |
|
|
@@ -30,9 +30,16 @@ from transformers import Qwen2_5_VLForConditionalGeneration
|
|
| 30 |
|
| 31 |
from diffusers.models.autoencoders import AutoencoderKL
|
| 32 |
try:
|
|
|
|
|
|
|
|
|
|
| 33 |
from ...models.transformers import OmniGen2Transformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
except (ImportError, RuntimeError):
|
| 35 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 36 |
from ...models.transformers.repo import OmniGen2RotaryPosEmbed
|
| 37 |
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
|
| 38 |
from diffusers.utils import (
|
|
|
|
| 30 |
|
| 31 |
from diffusers.models.autoencoders import AutoencoderKL
|
| 32 |
try:
|
| 33 |
+
try:
|
| 34 |
+
try:
|
| 35 |
+
try:
|
| 36 |
from ...models.transformers import OmniGen2Transformer2DModel
|
| 37 |
+
except (ImportError, RuntimeError):
|
| 38 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 41 |
+
except (ImportError, RuntimeError):
|
| 42 |
except (ImportError, RuntimeError):
|
|
|
|
| 43 |
from ...models.transformers.repo import OmniGen2RotaryPosEmbed
|
| 44 |
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
|
| 45 |
from diffusers.utils import (
|
|
@@ -30,9 +30,16 @@ from transformers import Qwen2_5_VLForConditionalGeneration
|
|
| 30 |
|
| 31 |
from diffusers.models.autoencoders import AutoencoderKL
|
| 32 |
try:
|
|
|
|
|
|
|
|
|
|
| 33 |
from ...models.transformers import OmniGen2Transformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
except (ImportError, RuntimeError):
|
| 35 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 36 |
from ...models.transformers.repo import OmniGen2RotaryPosEmbed
|
| 37 |
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
|
| 38 |
from diffusers.utils import (
|
|
|
|
| 30 |
|
| 31 |
from diffusers.models.autoencoders import AutoencoderKL
|
| 32 |
try:
|
| 33 |
+
try:
|
| 34 |
+
try:
|
| 35 |
+
try:
|
| 36 |
from ...models.transformers import OmniGen2Transformer2DModel
|
| 37 |
+
except (ImportError, RuntimeError):
|
| 38 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 41 |
+
except (ImportError, RuntimeError):
|
| 42 |
except (ImportError, RuntimeError):
|
|
|
|
| 43 |
from ...models.transformers.repo import OmniGen2RotaryPosEmbed
|
| 44 |
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
|
| 45 |
from diffusers.utils import (
|
|
@@ -44,9 +44,16 @@ import yaml
|
|
| 44 |
|
| 45 |
from transformers import AutoTokenizer, Qwen3VLTextModel
|
| 46 |
try:
|
|
|
|
|
|
|
|
|
|
| 47 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
except (ImportError, RuntimeError):
|
| 49 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 50 |
|
| 51 |
from toolkit.accelerator import unwrap_model
|
| 52 |
from toolkit.basic import flush
|
|
@@ -61,9 +68,16 @@ from toolkit.train_tools import apply_noise_offset
|
|
| 61 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 62 |
|
| 63 |
try:
|
|
|
|
|
|
|
|
|
|
| 64 |
from .src.transformer_prx import PRXTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
except (ImportError, RuntimeError):
|
| 66 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 67 |
from .src.pipeline import PRXPixelPipeline
|
| 68 |
|
| 69 |
|
|
|
|
| 44 |
|
| 45 |
from transformers import AutoTokenizer, Qwen3VLTextModel
|
| 46 |
try:
|
| 47 |
+
try:
|
| 48 |
+
try:
|
| 49 |
+
try:
|
| 50 |
from optimum.quanto import freeze
|
| 51 |
+
except (ImportError, RuntimeError):
|
| 52 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 53 |
+
except (ImportError, RuntimeError):
|
| 54 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 55 |
+
except (ImportError, RuntimeError):
|
| 56 |
except (ImportError, RuntimeError):
|
|
|
|
| 57 |
|
| 58 |
from toolkit.accelerator import unwrap_model
|
| 59 |
from toolkit.basic import flush
|
|
|
|
| 68 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 69 |
|
| 70 |
try:
|
| 71 |
+
try:
|
| 72 |
+
try:
|
| 73 |
+
try:
|
| 74 |
from .src.transformer_prx import PRXTransformer2DModel
|
| 75 |
+
except (ImportError, RuntimeError):
|
| 76 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 77 |
+
except (ImportError, RuntimeError):
|
| 78 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 79 |
+
except (ImportError, RuntimeError):
|
| 80 |
except (ImportError, RuntimeError):
|
|
|
|
| 81 |
from .src.pipeline import PRXPixelPipeline
|
| 82 |
|
| 83 |
|
|
@@ -1,7 +1,14 @@
|
|
| 1 |
# Everything diffusers does NOT ship (until PR #13928 lands) lives in src/:
|
| 2 |
# the vendored PRX transformer architecture and a minimal pixel-space sampler.
|
| 3 |
try:
|
|
|
|
|
|
|
|
|
|
| 4 |
from .transformer_prx import PRXTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
except (ImportError, RuntimeError):
|
| 6 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 7 |
from .pipeline import PRXPixelPipeline
|
|
|
|
| 1 |
# Everything diffusers does NOT ship (until PR #13928 lands) lives in src/:
|
| 2 |
# the vendored PRX transformer architecture and a minimal pixel-space sampler.
|
| 3 |
try:
|
| 4 |
+
try:
|
| 5 |
+
try:
|
| 6 |
+
try:
|
| 7 |
from .transformer_prx import PRXTransformer2DModel
|
| 8 |
+
except (ImportError, RuntimeError):
|
| 9 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 10 |
+
except (ImportError, RuntimeError):
|
| 11 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 12 |
+
except (ImportError, RuntimeError):
|
| 13 |
except (ImportError, RuntimeError):
|
|
|
|
| 14 |
from .pipeline import PRXPixelPipeline
|
|
@@ -39,9 +39,16 @@ from diffusers.models.attention import AttentionMixin, AttentionModuleMixin
|
|
| 39 |
from diffusers.models.attention_dispatch import dispatch_attention_fn
|
| 40 |
from diffusers.models.embeddings import get_timestep_embedding
|
| 41 |
try:
|
|
|
|
|
|
|
|
|
|
| 42 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
except (ImportError, RuntimeError):
|
| 44 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 45 |
from diffusers.models.modeling_utils import ModelMixin
|
| 46 |
from diffusers.models.normalization import RMSNorm
|
| 47 |
|
|
|
|
| 39 |
from diffusers.models.attention_dispatch import dispatch_attention_fn
|
| 40 |
from diffusers.models.embeddings import get_timestep_embedding
|
| 41 |
try:
|
| 42 |
+
try:
|
| 43 |
+
try:
|
| 44 |
+
try:
|
| 45 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
| 46 |
+
except (ImportError, RuntimeError):
|
| 47 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 48 |
+
except (ImportError, RuntimeError):
|
| 49 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 50 |
+
except (ImportError, RuntimeError):
|
| 51 |
except (ImportError, RuntimeError):
|
|
|
|
| 52 |
from diffusers.models.modeling_utils import ModelMixin
|
| 53 |
from diffusers.models.normalization import RMSNorm
|
| 54 |
|
|
@@ -14,9 +14,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 14 |
)
|
| 15 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 16 |
try:
|
|
|
|
|
|
|
|
|
|
| 17 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
except (ImportError, RuntimeError):
|
| 19 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 20 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 21 |
import torch.nn.functional as F
|
| 22 |
from toolkit.memory_management import MemoryManager
|
|
|
|
| 14 |
)
|
| 15 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 16 |
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
+
try:
|
| 20 |
from optimum.quanto import freeze, QTensor
|
| 21 |
+
except (ImportError, RuntimeError):
|
| 22 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
except (ImportError, RuntimeError):
|
|
|
|
| 27 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 28 |
import torch.nn.functional as F
|
| 29 |
from toolkit.memory_management import MemoryManager
|
|
@@ -15,9 +15,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 15 |
)
|
| 16 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 17 |
try:
|
|
|
|
|
|
|
|
|
|
| 18 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
except (ImportError, RuntimeError):
|
| 20 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 21 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 22 |
import torch.nn.functional as F
|
| 23 |
|
|
|
|
| 15 |
)
|
| 16 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 17 |
try:
|
| 18 |
+
try:
|
| 19 |
+
try:
|
| 20 |
+
try:
|
| 21 |
from optimum.quanto import freeze, QTensor
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 26 |
+
except (ImportError, RuntimeError):
|
| 27 |
except (ImportError, RuntimeError):
|
|
|
|
| 28 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 29 |
import torch.nn.functional as F
|
| 30 |
|
|
@@ -15,9 +15,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 15 |
)
|
| 16 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 17 |
try:
|
|
|
|
|
|
|
|
|
|
| 18 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
except (ImportError, RuntimeError):
|
| 20 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 21 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 22 |
import torch.nn.functional as F
|
| 23 |
|
|
|
|
| 15 |
)
|
| 16 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 17 |
try:
|
| 18 |
+
try:
|
| 19 |
+
try:
|
| 20 |
+
try:
|
| 21 |
from optimum.quanto import freeze, QTensor
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 26 |
+
except (ImportError, RuntimeError):
|
| 27 |
except (ImportError, RuntimeError):
|
|
|
|
| 28 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 29 |
import torch.nn.functional as F
|
| 30 |
|
|
@@ -8,9 +8,16 @@ from .wan22_pipeline import Wan22Pipeline
|
|
| 8 |
|
| 9 |
from toolkit.data_transfer_object.data_loader import DataLoaderBatchDTO
|
| 10 |
try:
|
|
|
|
|
|
|
|
|
|
| 11 |
from diffusers import WanImageToVideoPipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
except (ImportError, RuntimeError):
|
| 13 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 14 |
from torchvision.transforms import functional as TF
|
| 15 |
|
| 16 |
from .wan22_14b_model import Wan2214bModel
|
|
|
|
| 8 |
|
| 9 |
from toolkit.data_transfer_object.data_loader import DataLoaderBatchDTO
|
| 10 |
try:
|
| 11 |
+
try:
|
| 12 |
+
try:
|
| 13 |
+
try:
|
| 14 |
from diffusers import WanImageToVideoPipeline
|
| 15 |
+
except (ImportError, RuntimeError):
|
| 16 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 17 |
+
except (ImportError, RuntimeError):
|
| 18 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
+
except (ImportError, RuntimeError):
|
| 20 |
except (ImportError, RuntimeError):
|
|
|
|
| 21 |
from torchvision.transforms import functional as TF
|
| 22 |
|
| 23 |
from .wan22_14b_model import Wan2214bModel
|
|
@@ -10,9 +10,16 @@ from toolkit.models.wan21.wan_utils import add_first_frame_conditioning
|
|
| 10 |
from toolkit.prompt_utils import PromptEmbeds
|
| 11 |
from PIL import Image
|
| 12 |
try:
|
|
|
|
|
|
|
|
|
|
| 13 |
from diffusers import UniPCMultistepScheduler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
except (ImportError, RuntimeError):
|
| 15 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 16 |
import torch
|
| 17 |
from toolkit.config_modules import GenerateImageConfig, ModelConfig
|
| 18 |
from toolkit.samplers.custom_flowmatch_sampler import (
|
|
@@ -21,9 +28,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 21 |
from toolkit.util.quantize import quantize_model
|
| 22 |
from .wan22_pipeline import Wan22Pipeline
|
| 23 |
try:
|
|
|
|
|
|
|
|
|
|
| 24 |
from diffusers import WanTransformer3DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
except (ImportError, RuntimeError):
|
| 26 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
|
| 28 |
from toolkit.data_transfer_object.data_loader import DataLoaderBatchDTO
|
| 29 |
from torchvision.transforms import functional as TF
|
|
|
|
| 10 |
from toolkit.prompt_utils import PromptEmbeds
|
| 11 |
from PIL import Image
|
| 12 |
try:
|
| 13 |
+
try:
|
| 14 |
+
try:
|
| 15 |
+
try:
|
| 16 |
from diffusers import UniPCMultistepScheduler
|
| 17 |
+
except (ImportError, RuntimeError):
|
| 18 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
+
except (ImportError, RuntimeError):
|
| 20 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 21 |
+
except (ImportError, RuntimeError):
|
| 22 |
except (ImportError, RuntimeError):
|
|
|
|
| 23 |
import torch
|
| 24 |
from toolkit.config_modules import GenerateImageConfig, ModelConfig
|
| 25 |
from toolkit.samplers.custom_flowmatch_sampler import (
|
|
|
|
| 28 |
from toolkit.util.quantize import quantize_model
|
| 29 |
from .wan22_pipeline import Wan22Pipeline
|
| 30 |
try:
|
| 31 |
+
try:
|
| 32 |
+
try:
|
| 33 |
+
try:
|
| 34 |
from diffusers import WanTransformer3DModel
|
| 35 |
+
except (ImportError, RuntimeError):
|
| 36 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 37 |
+
except (ImportError, RuntimeError):
|
| 38 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
except (ImportError, RuntimeError):
|
|
|
|
| 41 |
|
| 42 |
from toolkit.data_transfer_object.data_loader import DataLoaderBatchDTO
|
| 43 |
from torchvision.transforms import functional as TF
|
|
@@ -3,9 +3,16 @@ import torch
|
|
| 3 |
from toolkit.prompt_utils import PromptEmbeds
|
| 4 |
from PIL import Image
|
| 5 |
try:
|
|
|
|
|
|
|
|
|
|
| 6 |
from diffusers import UniPCMultistepScheduler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
except (ImportError, RuntimeError):
|
| 8 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 9 |
import torch
|
| 10 |
from toolkit.config_modules import GenerateImageConfig, ModelConfig
|
| 11 |
from toolkit.samplers.custom_flowmatch_sampler import (
|
|
|
|
| 3 |
from toolkit.prompt_utils import PromptEmbeds
|
| 4 |
from PIL import Image
|
| 5 |
try:
|
| 6 |
+
try:
|
| 7 |
+
try:
|
| 8 |
+
try:
|
| 9 |
from diffusers import UniPCMultistepScheduler
|
| 10 |
+
except (ImportError, RuntimeError):
|
| 11 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 12 |
+
except (ImportError, RuntimeError):
|
| 13 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 14 |
+
except (ImportError, RuntimeError):
|
| 15 |
except (ImportError, RuntimeError):
|
|
|
|
| 16 |
import torch
|
| 17 |
from toolkit.config_modules import GenerateImageConfig, ModelConfig
|
| 18 |
from toolkit.samplers.custom_flowmatch_sampler import (
|
|
@@ -3,16 +3,30 @@ import torch
|
|
| 3 |
from toolkit.basic import flush
|
| 4 |
from transformers import AutoTokenizer, UMT5EncoderModel
|
| 5 |
try:
|
|
|
|
|
|
|
|
|
|
| 6 |
from diffusers import WanPipeline, WanTransformer3DModel, AutoencoderKLWan
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
except (ImportError, RuntimeError):
|
| 8 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 9 |
import torch
|
| 10 |
from diffusers import FlowMatchEulerDiscreteScheduler
|
| 11 |
from typing import List
|
| 12 |
try:
|
|
|
|
|
|
|
|
|
|
| 13 |
from diffusers.pipelines.wan.pipeline_output import WanPipelineOutput
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
except (ImportError, RuntimeError):
|
| 15 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 16 |
from diffusers.pipelines.wan.pipeline_wan import XLA_AVAILABLE
|
| 17 |
from diffusers.callbacks import MultiPipelineCallbacks, PipelineCallback
|
| 18 |
from typing import Any, Callable, Dict, List, Optional, Union
|
|
|
|
| 3 |
from toolkit.basic import flush
|
| 4 |
from transformers import AutoTokenizer, UMT5EncoderModel
|
| 5 |
try:
|
| 6 |
+
try:
|
| 7 |
+
try:
|
| 8 |
+
try:
|
| 9 |
from diffusers import WanPipeline, WanTransformer3DModel, AutoencoderKLWan
|
| 10 |
+
except (ImportError, RuntimeError):
|
| 11 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 12 |
+
except (ImportError, RuntimeError):
|
| 13 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 14 |
+
except (ImportError, RuntimeError):
|
| 15 |
except (ImportError, RuntimeError):
|
|
|
|
| 16 |
import torch
|
| 17 |
from diffusers import FlowMatchEulerDiscreteScheduler
|
| 18 |
from typing import List
|
| 19 |
try:
|
| 20 |
+
try:
|
| 21 |
+
try:
|
| 22 |
+
try:
|
| 23 |
from diffusers.pipelines.wan.pipeline_output import WanPipelineOutput
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 26 |
+
except (ImportError, RuntimeError):
|
| 27 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 28 |
+
except (ImportError, RuntimeError):
|
| 29 |
except (ImportError, RuntimeError):
|
|
|
|
| 30 |
from diffusers.pipelines.wan.pipeline_wan import XLA_AVAILABLE
|
| 31 |
from diffusers.callbacks import MultiPipelineCallbacks, PipelineCallback
|
| 32 |
from typing import Any, Callable, Dict, List, Optional, Union
|
|
@@ -14,9 +14,16 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 14 |
)
|
| 15 |
from toolkit.accelerator import unwrap_model
|
| 16 |
try:
|
|
|
|
|
|
|
|
|
|
| 17 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
except (ImportError, RuntimeError):
|
| 19 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 20 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 21 |
from toolkit.memory_management import MemoryManager
|
| 22 |
from safetensors.torch import load_file
|
|
@@ -26,7 +33,15 @@ from diffusers import AutoencoderKL
|
|
| 26 |
|
| 27 |
try:
|
| 28 |
from diffusers import ZImagePipeline
|
|
|
|
|
|
|
|
|
|
| 29 |
from diffusers.models.transformers import ZImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
except ImportError:
|
| 31 |
raise ImportError(
|
| 32 |
"Diffusers is out of date. Update diffusers to the latest version by doing pip uninstall diffusers and then pip install -r requirements.txt"
|
|
|
|
| 14 |
)
|
| 15 |
from toolkit.accelerator import unwrap_model
|
| 16 |
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
+
try:
|
| 20 |
from optimum.quanto import freeze
|
| 21 |
+
except (ImportError, RuntimeError):
|
| 22 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
except (ImportError, RuntimeError):
|
|
|
|
| 27 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 28 |
from toolkit.memory_management import MemoryManager
|
| 29 |
from safetensors.torch import load_file
|
|
|
|
| 33 |
|
| 34 |
try:
|
| 35 |
from diffusers import ZImagePipeline
|
| 36 |
+
try:
|
| 37 |
+
try:
|
| 38 |
+
try:
|
| 39 |
from diffusers.models.transformers import ZImageTransformer2DModel
|
| 40 |
+
except (ImportError, RuntimeError):
|
| 41 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 42 |
+
except (ImportError, RuntimeError):
|
| 43 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 44 |
+
except (ImportError, RuntimeError):
|
| 45 |
except ImportError:
|
| 46 |
raise ImportError(
|
| 47 |
"Diffusers is out of date. Update diffusers to the latest version by doing pip uninstall diffusers and then pip install -r requirements.txt"
|
|
@@ -10,9 +10,16 @@ import yaml
|
|
| 10 |
from toolkit.basic import flush
|
| 11 |
from toolkit.accelerator import unwrap_model
|
| 12 |
try:
|
|
|
|
|
|
|
|
|
|
| 13 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
except (ImportError, RuntimeError):
|
| 15 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 16 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 17 |
from toolkit.memory_management import MemoryManager
|
| 18 |
|
|
@@ -29,7 +36,15 @@ try:
|
|
| 29 |
from diffusers.models.transformers.transformer_z_image import (
|
| 30 |
ZImageTransformer2DModel as ZImageTransformer2DModelOriginal,
|
| 31 |
)
|
|
|
|
|
|
|
|
|
|
| 32 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
except ImportError:
|
| 34 |
raise ImportError(
|
| 35 |
"Diffusers is out of date. Update diffusers to the latest version by doing pip uninstall diffusers and then pip install -r requirements.txt"
|
|
|
|
| 10 |
from toolkit.basic import flush
|
| 11 |
from toolkit.accelerator import unwrap_model
|
| 12 |
try:
|
| 13 |
+
try:
|
| 14 |
+
try:
|
| 15 |
+
try:
|
| 16 |
from optimum.quanto import freeze
|
| 17 |
+
except (ImportError, RuntimeError):
|
| 18 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
+
except (ImportError, RuntimeError):
|
| 20 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 21 |
+
except (ImportError, RuntimeError):
|
| 22 |
except (ImportError, RuntimeError):
|
|
|
|
| 23 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 24 |
from toolkit.memory_management import MemoryManager
|
| 25 |
|
|
|
|
| 36 |
from diffusers.models.transformers.transformer_z_image import (
|
| 37 |
ZImageTransformer2DModel as ZImageTransformer2DModelOriginal,
|
| 38 |
)
|
| 39 |
+
try:
|
| 40 |
+
try:
|
| 41 |
+
try:
|
| 42 |
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
| 43 |
+
except (ImportError, RuntimeError):
|
| 44 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 45 |
+
except (ImportError, RuntimeError):
|
| 46 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 47 |
+
except (ImportError, RuntimeError):
|
| 48 |
except ImportError:
|
| 49 |
raise ImportError(
|
| 50 |
"Diffusers is out of date. Update diffusers to the latest version by doing pip uninstall diffusers and then pip install -r requirements.txt"
|
|
@@ -14,16 +14,30 @@ from toolkit.samplers.custom_flowmatch_sampler import (
|
|
| 14 |
)
|
| 15 |
from toolkit.accelerator import unwrap_model
|
| 16 |
try:
|
|
|
|
|
|
|
|
|
|
| 17 |
from optimum.quanto import freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
except (ImportError, RuntimeError):
|
| 19 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 20 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 21 |
from toolkit.memory_management import MemoryManager
|
| 22 |
from safetensors.torch import load_file
|
| 23 |
try:
|
|
|
|
|
|
|
|
|
|
| 24 |
from optimum.quanto import QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
except (ImportError, RuntimeError):
|
| 26 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
from toolkit.metadata import get_meta_for_safetensors
|
| 28 |
from safetensors.torch import load_file, save_file
|
| 29 |
from transformers import AutoTokenizer, Qwen3ForCausalLM
|
|
|
|
| 14 |
)
|
| 15 |
from toolkit.accelerator import unwrap_model
|
| 16 |
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
+
try:
|
| 20 |
from optimum.quanto import freeze
|
| 21 |
+
except (ImportError, RuntimeError):
|
| 22 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
except (ImportError, RuntimeError):
|
|
|
|
| 27 |
from toolkit.util.quantize import quantize, get_qtype, quantize_model
|
| 28 |
from toolkit.memory_management import MemoryManager
|
| 29 |
from safetensors.torch import load_file
|
| 30 |
try:
|
| 31 |
+
try:
|
| 32 |
+
try:
|
| 33 |
+
try:
|
| 34 |
from optimum.quanto import QTensor
|
| 35 |
+
except (ImportError, RuntimeError):
|
| 36 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 37 |
+
except (ImportError, RuntimeError):
|
| 38 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 39 |
+
except (ImportError, RuntimeError):
|
| 40 |
except (ImportError, RuntimeError):
|
|
|
|
| 41 |
from toolkit.metadata import get_meta_for_safetensors
|
| 42 |
from safetensors.torch import load_file, save_file
|
| 43 |
from transformers import AutoTokenizer, Qwen3ForCausalLM
|
|
@@ -16,9 +16,16 @@ from toolkit.models.flux import add_model_gpu_splitter_to_flux, bypass_flux_guid
|
|
| 16 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 17 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 18 |
try:
|
|
|
|
|
|
|
|
|
|
| 19 |
from optimum.quanto import freeze, QTensor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
except (ImportError, RuntimeError):
|
| 21 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
from toolkit.util.mask import generate_random_mask, random_dialate_mask
|
| 23 |
from toolkit.util.quantize import quantize, get_qtype
|
| 24 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer
|
|
|
|
| 16 |
from toolkit.dequantize import patch_dequantization_on_save
|
| 17 |
from toolkit.accelerator import get_accelerator, unwrap_model
|
| 18 |
try:
|
| 19 |
+
try:
|
| 20 |
+
try:
|
| 21 |
+
try:
|
| 22 |
from optimum.quanto import freeze, QTensor
|
| 23 |
+
except (ImportError, RuntimeError):
|
| 24 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 25 |
+
except (ImportError, RuntimeError):
|
| 26 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 27 |
+
except (ImportError, RuntimeError):
|
| 28 |
except (ImportError, RuntimeError):
|
|
|
|
| 29 |
from toolkit.util.mask import generate_random_mask, random_dialate_mask
|
| 30 |
from toolkit.util.quantize import quantize, get_qtype
|
| 31 |
from transformers import T5TokenizerFast, T5EncoderModel, CLIPTextModel, CLIPTokenizer
|
|
@@ -5,9 +5,16 @@ from typing import Union, Literal, List, Optional
|
|
| 5 |
|
| 6 |
import numpy as np
|
| 7 |
try:
|
|
|
|
|
|
|
|
|
|
| 8 |
from diffusers import T2IAdapter, AutoencoderTiny, ControlNetModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
except (ImportError, RuntimeError):
|
| 10 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 11 |
|
| 12 |
import torch.functional as F
|
| 13 |
from safetensors.torch import load_file
|
|
|
|
| 5 |
|
| 6 |
import numpy as np
|
| 7 |
try:
|
| 8 |
+
try:
|
| 9 |
+
try:
|
| 10 |
+
try:
|
| 11 |
from diffusers import T2IAdapter, AutoencoderTiny, ControlNetModel
|
| 12 |
+
except (ImportError, RuntimeError):
|
| 13 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 14 |
+
except (ImportError, RuntimeError):
|
| 15 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 16 |
+
except (ImportError, RuntimeError):
|
| 17 |
except (ImportError, RuntimeError):
|
|
|
|
| 18 |
|
| 19 |
import torch.functional as F
|
| 20 |
from safetensors.torch import load_file
|
|
@@ -13,9 +13,16 @@ from typing import Union, List, Optional
|
|
| 13 |
import numpy as np
|
| 14 |
import yaml
|
| 15 |
try:
|
|
|
|
|
|
|
|
|
|
| 16 |
from diffusers import T2IAdapter, ControlNetModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
except (ImportError, RuntimeError):
|
| 18 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 19 |
from diffusers.training_utils import compute_density_for_timestep_sampling
|
| 20 |
from safetensors.torch import save_file, load_file
|
| 21 |
# from lycoris.config import PRESET
|
|
@@ -38,9 +45,16 @@ from toolkit.lora_special import LoRASpecialNetwork
|
|
| 38 |
from toolkit.lorm import convert_diffusers_unet_to_lorm, count_parameters, print_lorm_extract_details, \
|
| 39 |
lorm_ignore_if_contains, lorm_parameter_threshold, LORM_TARGET_REPLACE_MODULE
|
| 40 |
try:
|
|
|
|
|
|
|
|
|
|
| 41 |
from toolkit.lycoris_special import LycorisSpecialNetwork
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
except (ImportError, RuntimeError):
|
| 43 |
-
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 44 |
from toolkit.models.decorator import Decorator
|
| 45 |
from toolkit.network_mixins import Network
|
| 46 |
from toolkit.optimizer import get_optimizer
|
|
|
|
| 13 |
import numpy as np
|
| 14 |
import yaml
|
| 15 |
try:
|
| 16 |
+
try:
|
| 17 |
+
try:
|
| 18 |
+
try:
|
| 19 |
from diffusers import T2IAdapter, ControlNetModel
|
| 20 |
+
except (ImportError, RuntimeError):
|
| 21 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 22 |
+
except (ImportError, RuntimeError):
|
| 23 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 24 |
+
except (ImportError, RuntimeError):
|
| 25 |
except (ImportError, RuntimeError):
|
|
|
|
| 26 |
from diffusers.training_utils import compute_density_for_timestep_sampling
|
| 27 |
from safetensors.torch import save_file, load_file
|
| 28 |
# from lycoris.config import PRESET
|
|
|
|
| 45 |
from toolkit.lorm import convert_diffusers_unet_to_lorm, count_parameters, print_lorm_extract_details, \
|
| 46 |
lorm_ignore_if_contains, lorm_parameter_threshold, LORM_TARGET_REPLACE_MODULE
|
| 47 |
try:
|
| 48 |
+
try:
|
| 49 |
+
try:
|
| 50 |
+
try:
|
| 51 |
from toolkit.lycoris_special import LycorisSpecialNetwork
|
| 52 |
+
except (ImportError, RuntimeError):
|
| 53 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 54 |
+
except (ImportError, RuntimeError):
|
| 55 |
+
pass # SPOCK-FORK 2026-07-05: deferred non-FLUX path
|
| 56 |
+
except (ImportError, RuntimeError):
|
| 57 |
except (ImportError, RuntimeError):
|
|
|
|
| 58 |
from toolkit.models.decorator import Decorator
|
| 59 |
from toolkit.network_mixins import Network
|
| 60 |
from toolkit.optimizer import get_optimizer
|