gokaygokay commited on
Commit
109512f
1 Parent(s): ad540bf
Files changed (4) hide show
  1. __init__.py +0 -0
  2. app.py +1 -5
  3. module/aggregator.py +1 -1
  4. setup_local_diffusers.py +0 -40
__init__.py DELETED
File without changes
app.py CHANGED
@@ -1,5 +1,4 @@
1
- import setup_local_diffusers
2
- setup_local_diffusers.setup_local_diffusers()
3
  import spaces
4
  import gradio as gr
5
  from gradio_imageslider import ImageSlider
@@ -13,9 +12,6 @@ from module.ip_adapter.utils import load_adapter_to_pipe
13
  from pipelines.sdxl_instantir import InstantIRPipeline
14
  import os
15
 
16
- import os
17
- import sys
18
-
19
  os.makedirs('./models', exist_ok=True)
20
  # Download model files if not present
21
  for filename in ["adapter.pt", "aggregator.pt", "previewer_lora_weights.bin"]:
 
1
+
 
2
  import spaces
3
  import gradio as gr
4
  from gradio_imageslider import ImageSlider
 
12
  from pipelines.sdxl_instantir import InstantIRPipeline
13
  import os
14
 
 
 
 
15
  os.makedirs('./models', exist_ok=True)
16
  # Download model files if not present
17
  for filename in ["adapter.pt", "aggregator.pt", "previewer_lora_weights.bin"]:
module/aggregator.py CHANGED
@@ -6,7 +6,7 @@ from torch import nn
6
  from torch.nn import functional as F
7
 
8
  from diffusers.configuration_utils import ConfigMixin, register_to_config
9
- from diffusers.loaders.single_file_model import FromOriginalModelMixin
10
  from diffusers.utils import BaseOutput, logging
11
  from diffusers.models.attention_processor import (
12
  ADDED_KV_ATTENTION_PROCESSORS,
 
6
  from torch.nn import functional as F
7
 
8
  from diffusers.configuration_utils import ConfigMixin, register_to_config
9
+ from diffusers.loaders.single_file import FromOriginalModelMixin
10
  from diffusers.utils import BaseOutput, logging
11
  from diffusers.models.attention_processor import (
12
  ADDED_KV_ATTENTION_PROCESSORS,
setup_local_diffusers.py DELETED
@@ -1,40 +0,0 @@
1
- import os
2
- import sys
3
- import subprocess
4
-
5
- def setup_local_diffusers():
6
- # 1. Try to uninstall existing diffusers package
7
- try:
8
- subprocess.check_call([sys.executable, "-m", "pip", "uninstall", "diffusers", "-y"])
9
- print("Successfully uninstalled existing diffusers package")
10
- except subprocess.CalledProcessError:
11
- print("No existing diffusers package found to uninstall")
12
-
13
- # 2. Get the current directory and add it to PYTHONPATH
14
- current_dir = os.path.dirname(os.path.abspath(__file__))
15
-
16
- # Add the parent directory of diffusers to Python path
17
- if current_dir not in sys.path:
18
- sys.path.insert(0, current_dir)
19
- print(f"Added {current_dir} to PYTHONPATH")
20
-
21
- # 3. Verify the import works
22
- try:
23
- import diffusers
24
- print(f"Successfully imported diffusers from: {diffusers.__file__}")
25
-
26
- # Verify specific module exists
27
- from diffusers.loaders.single_file import FromOriginalModelMixin
28
- print("Successfully imported FromOriginalModelMixin")
29
-
30
- return True
31
- except ImportError as e:
32
- print(f"Failed to import diffusers: {e}")
33
- return False
34
-
35
- if __name__ == "__main__":
36
- success = setup_local_diffusers()
37
- if success:
38
- print("Local diffusers setup completed successfully")
39
- else:
40
- print("Failed to setup local diffusers")