tori29umai commited on
Commit
245de5e
β€’
1 Parent(s): 6e9b1b6
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -162,7 +162,9 @@ class webui:
162
  self.demo = gr.Blocks()
163
 
164
  def main(self, image_path):
165
- image = Image.open(image_path).convert('RGBA')
 
 
166
  #ζ‹‘εΌ΅ε­γ‚’ε–γ‚Šι™€γ„γŸγƒ•γ‚‘γ‚€γƒ«εγ‚’ε–εΎ—
167
  image_name = os.path.splitext(image_path)[0]
168
  alpha = image.getchannel('A') if image.mode == 'RGBA' else None
 
162
  self.demo = gr.Blocks()
163
 
164
  def main(self, image_path):
165
+ image = Image.open(image_path)
166
+ if image.mode != 'RGBA':
167
+ image = image.convert('RGBA')
168
  #ζ‹‘εΌ΅ε­γ‚’ε–γ‚Šι™€γ„γŸγƒ•γ‚‘γ‚€γƒ«εγ‚’ε–εΎ—
169
  image_name = os.path.splitext(image_path)[0]
170
  alpha = image.getchannel('A') if image.mode == 'RGBA' else None