jhj0517 commited on
Commit
607e627
1 Parent(s): fbd23d6

rollback pytoshop because it doesn't work in huggingface

Browse files
modules/html_constants.py CHANGED
@@ -14,7 +14,8 @@ PROJECT_NAME = """
14
  """
15
 
16
  MARKDOWN_NOTE = """
17
- **If you want to run your own local GPU , please visit this [repository](https://github.com/jhj0517/Layer-Divider-WebUI).**
 
18
  """
19
 
20
  PARAMS_EXPLANATION = """
 
14
  """
15
 
16
  MARKDOWN_NOTE = """
17
+ **If you want to run your own local GPU , please visit this [repository](https://github.com/jhj0517/Layer-Divider-WebUI).
18
+ The repository also supports layered PSD (Photoshop) file!**
19
  """
20
 
21
  PARAMS_EXPLANATION = """
modules/mask_utils.py CHANGED
@@ -87,7 +87,6 @@ def save_psd(input_image_data, layer_data, layer_names, blending_modes):
87
  timestamp = datetime.now().strftime("%m%d%H%M%S")
88
  with open(f"outputs/psd/result-{timestamp}.psd", 'wb') as output_file:
89
  psd_file.write(output_file)
90
- return f"outputs/psd/result-{timestamp}.psd"
91
 
92
 
93
  def save_psd_with_masks(image, masks):
@@ -95,6 +94,6 @@ def save_psd_with_masks(image, masks):
95
  mask_layers = create_mask_layers(image, masks)
96
  names = [f'Part {i}' for i in range(len(mask_layers))]
97
  modes = [BlendMode.normal] * (len(mask_layers)+1)
98
- return save_psd(image, original_layer+mask_layers, ['Original_Image']+names, modes)
99
 
100
 
 
87
  timestamp = datetime.now().strftime("%m%d%H%M%S")
88
  with open(f"outputs/psd/result-{timestamp}.psd", 'wb') as output_file:
89
  psd_file.write(output_file)
 
90
 
91
 
92
  def save_psd_with_masks(image, masks):
 
94
  mask_layers = create_mask_layers(image, masks)
95
  names = [f'Part {i}' for i in range(len(mask_layers))]
96
  modes = [BlendMode.normal] * (len(mask_layers)+1)
97
+ save_psd(image, original_layer+mask_layers, ['Original_Image']+names, modes)
98
 
99
 
modules/sam.py CHANGED
@@ -62,7 +62,6 @@ class SamInference:
62
  masks = self.mask_generator.generate(image)
63
  combined_image = create_mask_combined_images(image, masks)
64
  gallery = create_mask_gallery(image, masks)
65
- psd = save_psd_with_masks(image, masks)
66
- return [combined_image] + gallery, psd
67
  except Exception as e:
68
  print(e)
 
62
  masks = self.mask_generator.generate(image)
63
  combined_image = create_mask_combined_images(image, masks)
64
  gallery = create_mask_gallery(image, masks)
65
+ return [combined_image] + gallery
 
66
  except Exception as e:
67
  print(e)
requirements.txt CHANGED
@@ -7,4 +7,4 @@ matplotlib
7
  onnxruntime
8
  onnx
9
  gradio
10
- pytoshop
 
7
  onnxruntime
8
  onnx
9
  gradio
10
+ pytoshop==1.2.0