Skip to content

Commit

Permalink
refactor file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rootonchair committed Sep 2, 2024
1 parent 0ec7dd5 commit 00b5ffa
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 18 deletions.
Empty file added layer_diffuse/__init__.py
Empty file.
3 changes: 1 addition & 2 deletions loaders.py → layer_diffuse/loaders.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import torch
from safetensors.torch import load_file
from diffusers.models.attention_processor import Attention, IPAdapterAttnProcessor, IPAdapterAttnProcessor2_0, AttnProcessor2_0
from models import LoraLoader, AttentionSharingProcessor, IPAdapterAttnShareProcessor, AttentionSharingProcessor2_0, IPAdapterAttnShareProcessor2_0
from .models import LoraLoader, AttentionSharingProcessor, IPAdapterAttnShareProcessor, AttentionSharingProcessor2_0, IPAdapterAttnShareProcessor2_0


def merge_delta_weights_into_unet(pipe, delta_weights):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test_diffusers_bg_fg_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

from diffusers import StableDiffusionPipeline

from models import TransparentVAEDecoder
from loaders import load_lora_to_unet
from utils import rgba2rgbfp32, crop_and_resize_image
from layer_diffuse.models import TransparentVAEDecoder
from layer_diffuse.loaders import load_lora_to_unet
from layer_diffuse.utils import rgba2rgbfp32, crop_and_resize_image



Expand Down
6 changes: 3 additions & 3 deletions test_diffusers_fg_bg_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from diffusers import StableDiffusionPipeline

from models import TransparentVAEDecoder
from loaders import load_lora_to_unet
from utils import rgba2rgbfp32, crop_and_resize_image
from layer_diffuse.models import TransparentVAEDecoder
from layer_diffuse.loaders import load_lora_to_unet
from layer_diffuse.utils import rgba2rgbfp32, crop_and_resize_image



Expand Down
4 changes: 2 additions & 2 deletions test_diffusers_fg_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from diffusers import StableDiffusionPipeline

from models import TransparentVAEDecoder
from loaders import load_lora_to_unet
from layer_diffuse.models import TransparentVAEDecoder
from layer_diffuse.loaders import load_lora_to_unet



Expand Down
5 changes: 2 additions & 3 deletions test_diffusers_fg_only_conv_sdxl.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
import torch
from PIL import Image

from diffusers import StableDiffusionXLPipeline

from models import TransparentVAEDecoder
from loaders import merge_delta_weights_into_unet
from layer_diffuse.models import TransparentVAEDecoder
from layer_diffuse.loaders import merge_delta_weights_into_unet


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion test_diffusers_fg_only_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from diffusers import StableDiffusionXLPipeline

from models import TransparentVAEDecoder
from layer_diffuse.models import TransparentVAEDecoder

if __name__ == "__main__":

Expand Down
2 changes: 1 addition & 1 deletion test_diffusers_fg_only_sdxl_img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from diffusers import StableDiffusionXLInpaintPipeline

from models import TransparentVAEDecoder, TransparentVAEEncoder
from layer_diffuse.models import TransparentVAEDecoder, TransparentVAEEncoder


if __name__ == "__main__":
Expand Down
5 changes: 2 additions & 3 deletions test_diffusers_joint.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
import torch
from PIL import Image

from diffusers import StableDiffusionPipeline

from models import TransparentVAEDecoder, LoraLoader, AttentionSharingProcessor
from loaders import load_lora_to_unet
from layer_diffuse.models import TransparentVAEDecoder
from layer_diffuse.loaders import load_lora_to_unet



Expand Down

0 comments on commit 00b5ffa

Please sign in to comment.