Files
automatic/pipelines/bria/__init__.py
T
CalamitousFelicitousness bd60372cc5 refactor(pipelines): move per-arch transformer specs into packages
Specs for chrono, cogview, flux2_klein, glm, hunyuandit, hyimage, joy,
kandinsky, longcat, nucleus, ovis, pixart and prx lived module-level in
model_<arch>.py. Move each into pipelines/<arch>/__init__.py to match
the layout used by anima, bria, ernie, f_lite, lens, qwen, step1x and
vibe.

Each model_<arch>.py now imports its spec lazily inside the load
function, so the package only gets pulled in when that arch is actually
loaded (kandinsky 2.x never goes through native dispatch and stays
untouched).

Also drop the "without this spec..." crash paragraph from the new
package docstrings plus ernie/__init__.py and bria/__init__.py.
2026-05-31 00:24:33 +01:00

28 lines
999 B
Python

"""Bria pipeline package.
Exports :data:`BRIA_SPEC` and :data:`BRIA_FIBO_SPEC` for use by
:mod:`pipelines.model_bria` together with :mod:`pipelines.native_transformer`.
Bria ships two transformer variants:
- The original Bria family uses a custom :class:`BriaTransformer2DModel`
imported from :mod:`pipelines.bria.transformer_bria`. The custom class
has no entry in diffusers' ``SINGLE_FILE_LOADABLE_CLASSES`` table.
- Bria FIBO (and FIBO Edit) use the upstream
:class:`diffusers.BriaFiboTransformer2DModel`, which also lacks a
``SINGLE_FILE_LOADABLE_CLASSES`` entry.
Both specs use the default 3-prefix detection
(``model.diffusion_model.``, ``diffusion_model.``, ``net.``), no
converter, and no siblings.
"""
import diffusers
from pipelines.bria.transformer_bria import BriaTransformer2DModel
from pipelines.native_transformer import TransformerSpec
BRIA_SPEC = TransformerSpec(cls=BriaTransformer2DModel)
BRIA_FIBO_SPEC = TransformerSpec(cls=diffusers.BriaFiboTransformer2DModel)