yijin928 commited on
Commit
a92a559
·
verified ·
1 Parent(s): 7662943

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -9,6 +9,11 @@ import spaces
9
  from comfy import model_management
10
  from nodes import NODE_CLASS_MAPPINGS
11
 
 
 
 
 
 
12
  hf_hub_download(
13
  repo_id="Comfy-Org/stable-diffusion-v1-5-archive",
14
  filename="v1-5-pruned-emaonly-fp16.safetensors",
@@ -96,10 +101,6 @@ def add_extra_model_paths() -> None:
96
  print("Could not find the extra_model_paths config file.")
97
 
98
 
99
- add_comfyui_directory_to_sys_path()
100
- add_extra_model_paths()
101
-
102
-
103
  def import_custom_nodes() -> None:
104
  """Find all custom nodes in the custom_nodes folder and add those node objects to NODE_CLASS_MAPPINGS
105
 
@@ -122,9 +123,6 @@ def import_custom_nodes() -> None:
122
  # Initializing custom nodes
123
  init_extra_nodes()
124
 
125
-
126
- from nodes import NODE_CLASS_MAPPINGS
127
-
128
  @spaces.GPU(duration=60)
129
  def generate_image(positive_prompt, negative_prompt):
130
  import_custom_nodes()
 
9
  from comfy import model_management
10
  from nodes import NODE_CLASS_MAPPINGS
11
 
12
+ sys.path.append(os.path.abspath(os.path.dirname(__file__)))
13
+
14
+ add_comfyui_directory_to_sys_path()
15
+ add_extra_model_paths()
16
+
17
  hf_hub_download(
18
  repo_id="Comfy-Org/stable-diffusion-v1-5-archive",
19
  filename="v1-5-pruned-emaonly-fp16.safetensors",
 
101
  print("Could not find the extra_model_paths config file.")
102
 
103
 
 
 
 
 
104
  def import_custom_nodes() -> None:
105
  """Find all custom nodes in the custom_nodes folder and add those node objects to NODE_CLASS_MAPPINGS
106
 
 
123
  # Initializing custom nodes
124
  init_extra_nodes()
125
 
 
 
 
126
  @spaces.GPU(duration=60)
127
  def generate_image(positive_prompt, negative_prompt):
128
  import_custom_nodes()