Skip to content

Commit

Permalink
UPD
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartvauder committed Nov 6, 2024
1 parent 77a47e1 commit a759384
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.idea/
idea/
.venv/
venv/
.gitignore/
gitignore/
TechnicalFiles/pip_cache/
TechnicalFiles/cache/
TechnicalFiles/temp/
Expand Down
14 changes: 8 additions & 6 deletions LaunchFile/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
temp_dir = os.path.join("TechnicalFiles/temp")
os.makedirs(temp_dir, exist_ok=True)
os.environ["TMPDIR"] = temp_dir
unet_path = os.path.join("inputs/image/sd_models/rembg")
os.makedirs(unet_path, exist_ok=True)
os.environ["U2NET_HOME"] = unet_path
roop_path = os.path.join("ThirdPartyRepository/insightface_models")
os.makedirs(roop_path, exist_ok=True)
os.environ["insightface"] = roop_path
sys.modules['triton'] = None
from threading import Thread
import gradio as gr
Expand Down Expand Up @@ -512,10 +518,6 @@ def parse_pdf(pdf_path):


def remove_bg(src_img_path, out_img_path):
model_path = "inputs/image/sd_models/rembg"
os.makedirs(model_path, exist_ok=True)

os.environ["U2NET_HOME"] = model_path

with open(src_img_path, "rb") as input_file:
input_data = input_file.read()
Expand Down Expand Up @@ -6219,7 +6221,7 @@ def generate_image_ip_adapter_faceid(prompt, negative_prompt, face_image, s_scal
torch_dtype = torch.float32
variant = "fp32"

app = FaceAnalysis(name="buffalo_l", providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
app = FaceAnalysis(name="buffalo_l", root=roop_path, providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
app.prepare(ctx_id=0, det_size=(640, 640))

image = cv2.imread(face_image)
Expand Down Expand Up @@ -11315,7 +11317,7 @@ def create_footer():
<span style="margin-right: 15px;">🦙 llama-cpp-python: 0.3.1</span>
<span style="margin-right: 15px;">🖼️ stable-diffusion-cpp-python: 0.2.1</span>
<span style="margin-right: 15px;">🎵 rvc-python: 0.1.5</span>
<span>ℹ️ gradio: 5.4.0</span>
<span>ℹ️ gradio: 5.5.0</span>
</div>
"""
return gr.Markdown(footer_html)
Expand Down
2 changes: 1 addition & 1 deletion RequirementsFiles/requirements-СPU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ gitdb==4.0.11
GitPython==3.1.43
google-pasta==0.2.0
gpytoolbox==0.3.2
gradio==5.4.0
gradio==5.5.0
gradio_client==1.4.2
grpcio==1.62.2
gruut==2.2.3
Expand Down
2 changes: 1 addition & 1 deletion RequirementsFiles/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ GitPython==3.1.43
google-pasta==0.2.0
GPUtil==1.4.0
gpytoolbox==0.3.2
gradio==5.4.0
gradio==5.5.0
gradio_client==1.4.2
grpcio==1.62.2
gruut==2.2.3
Expand Down

0 comments on commit a759384

Please sign in to comment.