NightRaven109 commited on
Commit
fb68129
·
verified ·
1 Parent(s): 60681ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -7,7 +7,12 @@ import torch
7
  from diffusers import Flux2KleinPipeline
8
  from huggingface_hub import login, hf_hub_download
9
  from safetensors.torch import load_file
10
- from color_matcher import ColorMatcher
 
 
 
 
 
11
 
12
  dtype = torch.bfloat16
13
  device = "cuda" if torch.cuda.is_available() else "cpu"
 
7
  from diffusers import Flux2KleinPipeline
8
  from huggingface_hub import login, hf_hub_download
9
  from safetensors.torch import load_file
10
+ try:
11
+ from color_matcher import ColorMatcher
12
+ except ImportError:
13
+ import subprocess
14
+ subprocess.check_call(["pip", "install", "color-matcher"])
15
+ from color_matcher import ColorMatcher
16
 
17
  dtype = torch.bfloat16
18
  device = "cuda" if torch.cuda.is_available() else "cpu"