Spaces:
Running
on
Zero
Running
on
Zero
Add GPU decorators and update inpainting pipeline
Browse files
__pycache__/background_edit.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/background_edit.cpython-310.pyc and b/__pycache__/background_edit.cpython-310.pyc differ
|
|
|
__pycache__/inference.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/inference.cpython-310.pyc and b/__pycache__/inference.cpython-310.pyc differ
|
|
|
__pycache__/utils.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/utils.cpython-310.pyc and b/__pycache__/utils.cpython-310.pyc differ
|
|
|
background_edit.py
CHANGED
|
@@ -37,6 +37,7 @@ inpaint_pipe = StableDiffusionXLInpaintPipeline.from_pretrained(
|
|
| 37 |
use_auth_token=os.getenv("HF_TOKEN")
|
| 38 |
).to("cuda")
|
| 39 |
|
|
|
|
| 40 |
def run_background_removal_and_inpaint(image_path, prompt, negative_prompt, guidance_scale=10):
|
| 41 |
if not image_path or not os.path.isfile(image_path):
|
| 42 |
raise gr.Error("No valid image found. Please run Step 1 first.")
|
|
@@ -69,6 +70,7 @@ def run_background_removal_and_inpaint(image_path, prompt, negative_prompt, guid
|
|
| 69 |
|
| 70 |
return result
|
| 71 |
|
|
|
|
| 72 |
def run_clothing_inpaint(image, prompt, negative_prompt, guidance):
|
| 73 |
try:
|
| 74 |
print("[INFO] Step 3: Clothing segmentation and inpainting...", flush=True)
|
|
|
|
| 37 |
use_auth_token=os.getenv("HF_TOKEN")
|
| 38 |
).to("cuda")
|
| 39 |
|
| 40 |
+
@spaces.GPU
|
| 41 |
def run_background_removal_and_inpaint(image_path, prompt, negative_prompt, guidance_scale=10):
|
| 42 |
if not image_path or not os.path.isfile(image_path):
|
| 43 |
raise gr.Error("No valid image found. Please run Step 1 first.")
|
|
|
|
| 70 |
|
| 71 |
return result
|
| 72 |
|
| 73 |
+
@spaces.GPU
|
| 74 |
def run_clothing_inpaint(image, prompt, negative_prompt, guidance):
|
| 75 |
try:
|
| 76 |
print("[INFO] Step 3: Clothing segmentation and inpainting...", flush=True)
|
inference.py
CHANGED
|
@@ -18,6 +18,7 @@ pipe = AutoPipelineForImage2Image.from_pretrained(
|
|
| 18 |
|
| 19 |
pipe.load_lora_weights("theoracle/sdxl-lora-headshot")
|
| 20 |
|
|
|
|
| 21 |
def generate_with_lora(image, prompt, negative_prompt, strength, guidance_scale):
|
| 22 |
try:
|
| 23 |
if image is None:
|
|
|
|
| 18 |
|
| 19 |
pipe.load_lora_weights("theoracle/sdxl-lora-headshot")
|
| 20 |
|
| 21 |
+
@spaces.GPU
|
| 22 |
def generate_with_lora(image, prompt, negative_prompt, strength, guidance_scale):
|
| 23 |
try:
|
| 24 |
if image is None:
|