Spaces:
Running
on
Zero
Running
on
Zero
Buğrahan Dönmez
commited on
Commit
·
e09b028
1
Parent(s):
7c25d4e
Update files
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: 🔥
|
4 |
colorFrom: red
|
5 |
colorTo: purple
|
|
|
1 |
---
|
2 |
+
title: Inpaint Edit
|
3 |
emoji: 🔥
|
4 |
colorFrom: red
|
5 |
colorTo: purple
|
app.py
CHANGED
@@ -48,22 +48,6 @@ pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
|
|
48 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
49 |
|
50 |
|
51 |
-
|
52 |
-
def add_watermark(image, text="ProFaker", font_path="BRLNSDB.TTF", font_size=25):
|
53 |
-
# Load the Berlin Sans Demi font with the specified size
|
54 |
-
font = ImageFont.truetype(font_path, font_size)
|
55 |
-
|
56 |
-
# Position the watermark in the bottom right corner, adjusting for text size
|
57 |
-
text_bbox = font.getbbox(text)
|
58 |
-
text_width, text_height = text_bbox[2], text_bbox[3]
|
59 |
-
watermark_position = (image.width - text_width - 100, image.height - text_height - 150)
|
60 |
-
|
61 |
-
# Draw the watermark text with a translucent white color
|
62 |
-
draw = ImageDraw.Draw(image)
|
63 |
-
draw.text(watermark_position, text, font=font, fill=(255, 255, 255, 150)) # RGBA for transparency
|
64 |
-
|
65 |
-
return image
|
66 |
-
|
67 |
@spaces.GPU
|
68 |
def fill_image(prompt, negative_prompt, image, model_selection, paste_back, guidance_scale, num_steps):
|
69 |
(
|
@@ -101,7 +85,6 @@ def fill_image(prompt, negative_prompt, image, model_selection, paste_back, guid
|
|
101 |
else:
|
102 |
cnet_image = image
|
103 |
|
104 |
-
cnet_image = add_watermark(cnet_image)
|
105 |
yield source, cnet_image
|
106 |
|
107 |
|
@@ -109,7 +92,7 @@ def clear_result():
|
|
109 |
return gr.update(value=None)
|
110 |
|
111 |
|
112 |
-
title = """<h1 align="center">
|
113 |
|
114 |
with gr.Blocks() as demo:
|
115 |
gr.HTML(title)
|
|
|
48 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
49 |
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
@spaces.GPU
|
52 |
def fill_image(prompt, negative_prompt, image, model_selection, paste_back, guidance_scale, num_steps):
|
53 |
(
|
|
|
85 |
else:
|
86 |
cnet_image = image
|
87 |
|
|
|
88 |
yield source, cnet_image
|
89 |
|
90 |
|
|
|
92 |
return gr.update(value=None)
|
93 |
|
94 |
|
95 |
+
title = """<h1 align="center">Inpaint</h1>"""
|
96 |
|
97 |
with gr.Blocks() as demo:
|
98 |
gr.HTML(title)
|