FreeStyleFreeLunch / FreeStyle

FreeStyle : Free Lunch for Text-guided Style Transfer using Diffusion Models
109 stars 7 forks source link

diffusers import error #1

Open marson666 opened 9 months ago

marson666 commented 9 months ago

hi, thanks for you great work! i follow the README.md to install the deps, but when i run the stable_diffusion_xl_test.py, i find the import error below:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/test/Free-Lunch-for-Text-guided-Style-Transfer-using-Diffusion-Models/diffusers/src/diffusers/__init__.py", line 1, in <module>
    from ..utils import (
ImportError: attempted relative import beyond top-level package

look forward to your reply

JACKYLUO1991 commented 9 months ago

@marson666 I'm experiencing the same problem. Also, could the author list the file structure of the weights so that we can easily verify the results? @FreeStyleFreeLunch

Loafei123 commented 9 months ago

The model and its weight file directory structure are shown in the figure. Consistent with the given link structure. 微信图片_20240205013822

FreeStyleFreeLunch commented 9 months ago

The model and its weight file directory structure are shown in the figure. Consistent with the given link structure. 微信图片_20240205013822 @JACKYLUO1991 @marson666

JACKYLUO1991 commented 9 months ago

@FreeStyleFreeLunch What is the difference between the official diffusers==0.21.0 and the ones in the code base?

FreeStyleFreeLunch commented 9 months ago

Unlike the official version, the diffusers code provided in the file has been modified in the UNet section.

JACKYLUO1991 commented 9 months ago

@marson666 With so many bugs, did you run it successfully?

haofanwang commented 9 months ago

It is necessary to specify what modification has been made in UNet. If only several files get modified, can you make it compatible with official diffusers?

FreeStyleFreeLunch commented 9 months ago

We have made some modifications to the file structure within the diffusers project. Please download the code directly from the repository and install it following the instructions in the README.md file. We will endeavor to resolve any compatibility issues to the best of our ability in our subsequent work.

marson666 commented 9 months ago

@marson666 With so many bugs, did you run it successfully?

@JACKYLUO1991 not yet

loboere commented 8 months ago

Has anyone managed to run it in colab? I tried but I only get import errors

FreeStyleFreeLunch commented 8 months ago

The bug has been fixed and it should be running normally now. @loboere @marson666 @JACKYLUO1991 @haofanwang @marson666 @Loafei123

geyanqi commented 8 months ago

It is necessary to specify what modification has been made in UNet. If only several files get modified, can you make it compatible with official diffusers?

If I understand correctly, this part should be in:

upper branch:

  1. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers_test/pipeline_stable_diffusion_xl.py#L1007 where skip_stack == None

  2. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers/src/diffusers/models/unet_2d_condition.py#L976 return the unet encoder features to skip_stack,

lower branch:

  1. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers_test/pipeline_stable_diffusion_xl.py#L1018 where skip_stach is the upper branch's return

  2. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers/src/diffusers/models/unet_2d_condition.py#L97 use skip_stach

  3. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers/src/diffusers/models/unet_2d_blocks.py#L2182 core code.

loboere commented 8 months ago

I want to download sdxl in folders mode with !wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0 but download everything including fp16 mode and all that is 80gb. How do I download SDXL in folder mode without downloading repeated files?

ucasligang commented 7 months ago

How do I download SDXL in folder mode without downloading repeated files?

Have you solved it now?

BlueDyee commented 5 months ago

It is necessary to specify what modification has been made in UNet. If only several files get modified, can you make it compatible with official diffusers?

If I understand correctly, this part should be in:

upper branch:

  1. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers_test/pipeline_stable_diffusion_xl.py#L1007 where skip_stack == None
  2. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers/src/diffusers/models/unet_2d_condition.py#L976 return the unet encoder features to skip_stack,

lower branch:

  1. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers_test/pipeline_stable_diffusion_xl.py#L1018 where skip_stach is the upper branch's return
  2. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers/src/diffusers/models/unet_2d_condition.py#L97 use skip_stach
  3. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers/src/diffusers/models/unet_2d_blocks.py#L2182 core code.

Thank you for sharing your observation😍 this does save me a lot of time. But, I think there might be a typo (or maybe I misunderstood you) in this line: "> 2. https://github.com/FreeStyleFreeLunch/FreeStyle/blob/main/diffusers/src/diffusers/models/unet_2d_condition.py#L97

use skip_stach"

I guess this line is more correct "https://github.com/FreeStyleFreeLunch/FreeStyle/blob/c55481d4ab32ef0f96d72838253721707fede5c2/diffusers/src/diffusers/models/unet_2d_condition.py#L973"