mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
* start * add more logic * Update src/diffusers/models/unet_2d_condition_flax.py * match weights * up * make model work * making class more general, fixing missed file rename * small fix * make new conversion work * up * finalize conversion * up * first batch of variable renamings * remove c and c_prev var names * add mid and out block structure * add pipeline * up * finish conversion * finish * upload * more fixes * Apply suggestions from code review * add attr * up * uP * up * finish tests * finish * uP * finish * fix test * up * naming consistency in tests * Apply suggestions from code review Co-authored-by: Suraj Patil <surajp815@gmail.com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Nathan Lambert <nathan@huggingface.co> Co-authored-by: Anton Lozhkov <anton@huggingface.co> * remove hardcoded 16 * Remove bogus * fix some stuff * finish * improve logging * docs * upload Co-authored-by: Nathan Lambert <nol@berkeley.edu> Co-authored-by: Suraj Patil <surajp815@gmail.com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Nathan Lambert <nathan@huggingface.co> Co-authored-by: Anton Lozhkov <anton@huggingface.co>
101 lines
3.0 KiB
Python
101 lines
3.0 KiB
Python
from .utils import (
|
|
is_flax_available,
|
|
is_inflect_available,
|
|
is_onnx_available,
|
|
is_scipy_available,
|
|
is_torch_available,
|
|
is_transformers_available,
|
|
is_unidecode_available,
|
|
)
|
|
|
|
|
|
__version__ = "0.7.0.dev0"
|
|
|
|
from .configuration_utils import ConfigMixin
|
|
from .onnx_utils import OnnxRuntimeModel
|
|
from .utils import logging
|
|
|
|
|
|
if is_torch_available():
|
|
from .modeling_utils import ModelMixin
|
|
from .models import AutoencoderKL, UNet1DModel, UNet2DConditionModel, UNet2DModel, VQModel
|
|
from .optimization import (
|
|
get_constant_schedule,
|
|
get_constant_schedule_with_warmup,
|
|
get_cosine_schedule_with_warmup,
|
|
get_cosine_with_hard_restarts_schedule_with_warmup,
|
|
get_linear_schedule_with_warmup,
|
|
get_polynomial_decay_schedule_with_warmup,
|
|
get_scheduler,
|
|
)
|
|
from .pipeline_utils import DiffusionPipeline
|
|
from .pipelines import (
|
|
DanceDiffusionPipeline,
|
|
DDIMPipeline,
|
|
DDPMPipeline,
|
|
KarrasVePipeline,
|
|
LDMPipeline,
|
|
PNDMPipeline,
|
|
ScoreSdeVePipeline,
|
|
)
|
|
from .schedulers import (
|
|
DDIMScheduler,
|
|
DDPMScheduler,
|
|
IPNDMScheduler,
|
|
KarrasVeScheduler,
|
|
PNDMScheduler,
|
|
SchedulerMixin,
|
|
ScoreSdeVeScheduler,
|
|
)
|
|
from .training_utils import EMAModel
|
|
else:
|
|
from .utils.dummy_pt_objects import * # noqa F403
|
|
|
|
if is_torch_available() and is_scipy_available():
|
|
from .schedulers import LMSDiscreteScheduler
|
|
else:
|
|
from .utils.dummy_torch_and_scipy_objects import * # noqa F403
|
|
|
|
if is_torch_available() and is_transformers_available():
|
|
from .pipelines import (
|
|
LDMTextToImagePipeline,
|
|
StableDiffusionImg2ImgPipeline,
|
|
StableDiffusionInpaintPipeline,
|
|
StableDiffusionInpaintPipelineLegacy,
|
|
StableDiffusionPipeline,
|
|
)
|
|
else:
|
|
from .utils.dummy_torch_and_transformers_objects import * # noqa F403
|
|
|
|
if is_torch_available() and is_transformers_available() and is_onnx_available():
|
|
from .pipelines import (
|
|
OnnxStableDiffusionImg2ImgPipeline,
|
|
OnnxStableDiffusionInpaintPipeline,
|
|
OnnxStableDiffusionPipeline,
|
|
StableDiffusionOnnxPipeline,
|
|
)
|
|
else:
|
|
from .utils.dummy_torch_and_transformers_and_onnx_objects import * # noqa F403
|
|
|
|
if is_flax_available():
|
|
from .modeling_flax_utils import FlaxModelMixin
|
|
from .models.unet_2d_condition_flax import FlaxUNet2DConditionModel
|
|
from .models.vae_flax import FlaxAutoencoderKL
|
|
from .pipeline_flax_utils import FlaxDiffusionPipeline
|
|
from .schedulers import (
|
|
FlaxDDIMScheduler,
|
|
FlaxDDPMScheduler,
|
|
FlaxKarrasVeScheduler,
|
|
FlaxLMSDiscreteScheduler,
|
|
FlaxPNDMScheduler,
|
|
FlaxSchedulerMixin,
|
|
FlaxScoreSdeVeScheduler,
|
|
)
|
|
else:
|
|
from .utils.dummy_flax_objects import * # noqa F403
|
|
|
|
if is_flax_available() and is_transformers_available():
|
|
from .pipelines import FlaxStableDiffusionPipeline
|
|
else:
|
|
from .utils.dummy_flax_and_transformers_objects import * # noqa F403
|