mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-14 09:08:14 +00:00
shorter import paths
This commit is contained in:
parent
8615dbdbde
commit
18c84c7b72
|
@ -6,9 +6,11 @@ from torch import nn
|
||||||
from diffusers import ControlNetModel # type: ignore
|
from diffusers import ControlNetModel # type: ignore
|
||||||
from refiners.fluxion.utils import save_to_safetensors
|
from refiners.fluxion.utils import save_to_safetensors
|
||||||
from refiners.fluxion.model_converter import ModelConverter
|
from refiners.fluxion.model_converter import ModelConverter
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1 import SD1Controlnet
|
from refiners.foundationals.latent_diffusion import (
|
||||||
from refiners.foundationals.latent_diffusion.schedulers.dpm_solver import DPMSolver
|
SD1UNet,
|
||||||
from refiners.foundationals.latent_diffusion import SD1UNet
|
SD1Controlnet,
|
||||||
|
DPMSolver,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Args(argparse.Namespace):
|
class Args(argparse.Namespace):
|
||||||
|
|
|
@ -9,7 +9,7 @@ from diffusers import DiffusionPipeline # type: ignore
|
||||||
import refiners.fluxion.layers as fl
|
import refiners.fluxion.layers as fl
|
||||||
from refiners.fluxion.model_converter import ModelConverter
|
from refiners.fluxion.model_converter import ModelConverter
|
||||||
from refiners.fluxion.utils import save_to_safetensors
|
from refiners.fluxion.utils import save_to_safetensors
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.unet import SD1UNet
|
from refiners.foundationals.latent_diffusion import SD1UNet
|
||||||
from refiners.foundationals.latent_diffusion.lora import LoraTarget, apply_loras_to_target
|
from refiners.foundationals.latent_diffusion.lora import LoraTarget, apply_loras_to_target
|
||||||
from refiners.adapters.lora import Lora
|
from refiners.adapters.lora import Lora
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ from convert_transformers_clip_text_model import (
|
||||||
Args as TextEncoderConversionArgs,
|
Args as TextEncoderConversionArgs,
|
||||||
)
|
)
|
||||||
from refiners.foundationals.clip.text_encoder import CLIPTextEncoderL
|
from refiners.foundationals.clip.text_encoder import CLIPTextEncoderL
|
||||||
|
from refiners.foundationals.latent_diffusion import SD1UNet
|
||||||
from refiners.foundationals.latent_diffusion.lora import LoraTarget
|
from refiners.foundationals.latent_diffusion.lora import LoraTarget
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1 import SD1UNet
|
|
||||||
import refiners.fluxion.layers as fl
|
import refiners.fluxion.layers as fl
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,20 +5,14 @@ from refiners.foundationals.clip.text_encoder import (
|
||||||
CLIPTextEncoderL,
|
CLIPTextEncoderL,
|
||||||
)
|
)
|
||||||
from refiners.foundationals.latent_diffusion.schedulers import Scheduler, DPMSolver
|
from refiners.foundationals.latent_diffusion.schedulers import Scheduler, DPMSolver
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.model import (
|
from refiners.foundationals.latent_diffusion.stable_diffusion_1 import (
|
||||||
StableDiffusion_1,
|
StableDiffusion_1,
|
||||||
StableDiffusion_1_Inpainting,
|
StableDiffusion_1_Inpainting,
|
||||||
)
|
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.unet import (
|
|
||||||
SD1UNet,
|
SD1UNet,
|
||||||
)
|
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet import (
|
|
||||||
SD1Controlnet,
|
SD1Controlnet,
|
||||||
)
|
)
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_xl.unet import (
|
from refiners.foundationals.latent_diffusion.stable_diffusion_xl import (
|
||||||
SDXLUNet,
|
SDXLUNet,
|
||||||
)
|
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_xl.text_encoder import (
|
|
||||||
DoubleTextEncoder,
|
DoubleTextEncoder,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ from refiners.fluxion.layers import (
|
||||||
Parallel,
|
Parallel,
|
||||||
)
|
)
|
||||||
from refiners.adapters.adapter import Adapter
|
from refiners.adapters.adapter import Adapter
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.unet import SD1UNet
|
from refiners.foundationals.latent_diffusion import SD1UNet
|
||||||
from refiners.foundationals.latent_diffusion.cross_attention import CrossAttentionBlock
|
from refiners.foundationals.latent_diffusion.cross_attention import CrossAttentionBlock
|
||||||
from torch import Tensor
|
from torch import Tensor
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, TypeVar, TypedDict, cast
|
from typing import Any, TypeVar, TypedDict, cast
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from refiners.foundationals.latent_diffusion.schedulers.ddpm import DDPM
|
|
||||||
from torch import device as Device, Tensor, randn, dtype as DType, Generator, cat
|
from torch import device as Device, Tensor, randn, dtype as DType, Generator, cat
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
from torch.utils.data import Dataset
|
from torch.utils.data import Dataset
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.unet import SD1UNet
|
|
||||||
from refiners.foundationals.clip.text_encoder import CLIPTextEncoderL
|
from refiners.foundationals.clip.text_encoder import CLIPTextEncoderL
|
||||||
from refiners.foundationals.latent_diffusion.auto_encoder import LatentDiffusionAutoencoder
|
|
||||||
from torchvision.transforms import RandomCrop # type: ignore
|
from torchvision.transforms import RandomCrop # type: ignore
|
||||||
import refiners.fluxion.layers as fl
|
import refiners.fluxion.layers as fl
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from refiners.training_utils.config import BaseConfig
|
from refiners.training_utils.config import BaseConfig
|
||||||
from refiners.foundationals.latent_diffusion import StableDiffusion_1
|
from refiners.foundationals.latent_diffusion import (
|
||||||
from refiners.foundationals.latent_diffusion.schedulers import DPMSolver
|
StableDiffusion_1,
|
||||||
|
DPMSolver,
|
||||||
|
SD1UNet,
|
||||||
|
LatentDiffusionAutoencoder,
|
||||||
|
)
|
||||||
|
from refiners.foundationals.latent_diffusion.schedulers import DDPM
|
||||||
from torch.nn.functional import mse_loss
|
from torch.nn.functional import mse_loss
|
||||||
import random
|
import random
|
||||||
from refiners.training_utils.wandb import WandbLoggable
|
from refiners.training_utils.wandb import WandbLoggable
|
||||||
|
|
|
@ -8,9 +8,12 @@ from PIL import Image
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from refiners.fluxion.utils import load_from_safetensors, image_to_tensor, manual_seed
|
from refiners.fluxion.utils import load_from_safetensors, image_to_tensor, manual_seed
|
||||||
from refiners.foundationals.latent_diffusion import StableDiffusion_1, StableDiffusion_1_Inpainting
|
from refiners.foundationals.latent_diffusion import (
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.unet import SD1UNet
|
StableDiffusion_1,
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.controlnet import SD1Controlnet
|
StableDiffusion_1_Inpainting,
|
||||||
|
SD1UNet,
|
||||||
|
SD1Controlnet,
|
||||||
|
)
|
||||||
from refiners.foundationals.latent_diffusion.lora import LoraWeights
|
from refiners.foundationals.latent_diffusion.lora import LoraWeights
|
||||||
from refiners.foundationals.latent_diffusion.schedulers import DDIM
|
from refiners.foundationals.latent_diffusion.schedulers import DDIM
|
||||||
from refiners.foundationals.latent_diffusion.self_attention_injection import SelfAttentionInjection
|
from refiners.foundationals.latent_diffusion.self_attention_injection import SelfAttentionInjection
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from refiners.foundationals.latent_diffusion.stable_diffusion_1.unet import SD1UNet
|
from refiners.foundationals.latent_diffusion import SD1UNet
|
||||||
from refiners.fluxion import manual_seed
|
from refiners.fluxion import manual_seed
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue