Spaces:
Runtime error
Runtime error
Andranik Sargsyan
commited on
Commit
β’
08504da
1
Parent(s):
a973c78
add sbs image URLs
Browse files
README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
---
|
2 |
title: HD-Painter
|
3 |
emoji: π§βπ¨
|
|
|
4 |
colorFrom: green
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.47.1
|
8 |
python_version: 3.9
|
9 |
-
suggested_hardware: a100-large
|
10 |
app_file: app.py
|
11 |
pinned: false
|
12 |
pipeline_tag: hd-painter
|
|
|
1 |
---
|
2 |
title: HD-Painter
|
3 |
emoji: π§βπ¨
|
4 |
+
suggested_hardware: a10g-largex2
|
5 |
colorFrom: green
|
6 |
colorTo: blue
|
7 |
sdk: gradio
|
8 |
sdk_version: 3.47.1
|
9 |
python_version: 3.9
|
|
|
10 |
app_file: app.py
|
11 |
pinned: false
|
12 |
pipeline_tag: hd-painter
|
app.py
CHANGED
@@ -38,14 +38,14 @@ example_inputs = [
|
|
38 |
]
|
39 |
|
40 |
thumbnails = [
|
41 |
-
'
|
42 |
-
'
|
43 |
-
'
|
44 |
-
'
|
45 |
-
'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
'
|
49 |
]
|
50 |
|
51 |
example_previews = [
|
@@ -68,29 +68,11 @@ inpainting_models = OrderedDict([
|
|
68 |
sr_model = models.sd2_sr.load_model(device='cuda:1')
|
69 |
sam_predictor = models.sam.load_model(device='cuda:0')
|
70 |
|
71 |
-
inp_model =
|
72 |
-
cached_inp_model_name = ''
|
73 |
-
|
74 |
-
def remove_cached_inpainting_model():
|
75 |
-
global inp_model
|
76 |
-
global cached_inp_model_name
|
77 |
-
del inp_model
|
78 |
-
inp_model = None
|
79 |
-
cached_inp_model_name = ''
|
80 |
-
torch.cuda.empty_cache()
|
81 |
-
|
82 |
-
|
83 |
def set_model_from_name(inp_model_name):
|
84 |
-
global cached_inp_model_name
|
85 |
global inp_model
|
86 |
-
|
87 |
-
if inp_model_name == cached_inp_model_name:
|
88 |
-
print (f"Activating Cached Inpaintng Model: {inp_model_name}")
|
89 |
-
return
|
90 |
-
|
91 |
print (f"Activating Inpaintng Model: {inp_model_name}")
|
92 |
inp_model = inpainting_models[inp_model_name]
|
93 |
-
cached_inp_model_name = inp_model_name
|
94 |
|
95 |
|
96 |
def rasg_run(use_painta, prompt, input, seed, eta, negative_prompt, positive_prompt, ddim_steps,
|
@@ -177,12 +159,6 @@ def upscale_run(
|
|
177 |
negative_prompt='', positive_prompt=', high resolution professional photo'):
|
178 |
torch.cuda.empty_cache()
|
179 |
|
180 |
-
# Load SR model and SAM predictor
|
181 |
-
# sr_model = models.sd2_sr.load_model()
|
182 |
-
# sam_predictor = None
|
183 |
-
# if use_sam_mask:
|
184 |
-
# sam_predictor = models.sam.load_model()
|
185 |
-
|
186 |
seed = int(seed)
|
187 |
img_index = int(img_index)
|
188 |
|
@@ -232,7 +208,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
232 |
|
233 |
if on_huggingspace:
|
234 |
gr.HTML("""
|
235 |
-
<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings.
|
236 |
<br/>
|
237 |
<a href="https://huggingface.co/spaces/PAIR/HD-Painter?duplicate=true">
|
238 |
<img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
|
@@ -247,7 +223,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
247 |
with gr.Column():
|
248 |
model_picker = gr.Dropdown(
|
249 |
list(inpainting_models.keys()),
|
250 |
-
value=0,
|
251 |
label = "Please select a model!",
|
252 |
)
|
253 |
with gr.Column():
|
@@ -257,7 +233,7 @@ with gr.Blocks(css='style.css') as demo:
|
|
257 |
prompt = gr.Textbox(label = "Inpainting Prompt")
|
258 |
with gr.Row():
|
259 |
with gr.Column():
|
260 |
-
input = gr.ImageMask(label = "Input Image", brush_color='#ff0000', elem_id="inputmask")
|
261 |
|
262 |
with gr.Row():
|
263 |
inpaint_btn = gr.Button("Inpaint", scale = 0)
|
|
|
38 |
]
|
39 |
|
40 |
thumbnails = [
|
41 |
+
'https://lh3.googleusercontent.com/pw/ABLVV87iCMYxrA59EAiPc3eRTA59jGF2_sJSnwBSilXwx2wtVlEhCsla2CNhCte4oHuDc4Gix4r7QAlbyRrYkHHgT8v6SOhpElvzlS-Ve91lYUEsWeiOf5yix3b47zuW8gEq_n5qBAGocyMpnc0In52mvl3CYIYcXonJx3dXmFvhhSOegluIcnq33t70mkA75YNMaFz3ovDyq9AfCIFEXGqI6cPUSy9n-fvoAUwG5VZZONdWQPpAClk0Im981hvHuLHz3viAHTbrHL4kzEJNclgXFHGUfEB-IU-cUmCVWnXPEaBFnlu_YabcgFdDAfz-bOy0W64TuUAYDzY_X8mv2fKXMoO0KOnMGZL3j0x08rK8kFzs9opczNFwmRjDQJySNVC16upa2HqYBk3S_O-uhC6DPmfm-5RBKXaNrz_MDFKc7n4-DYEBGXz3drbC0U1AIhqvRf5i99QzQWaxccU-maHRJcKSXAndCW0tWxZpWiYx-PFlcUvKM8ls7ySk7JIFFz9gypjubtP2m205uoDwAd0qoXdxgjbFJB5S33PDXVA4qWh9VCs4QLM23H1hoVKzMxxsSXBRkI0-gQK1K6epmcNaEecS61MeUE-sSy24gAKDP00vIx7_RWCqDTMW9jJNm9cQrI7ZCZmSExczudzjb1zXu9r1B1NywGXfboI5cRw_YNZCjPxEHNTXkfV73bApnLnXBDLOSczfi7S4lurLBQh42gbdoMO9SfR0Ssaf5I15D8MGGvxAU9ol6BKxvxIc7PkCIBfs_-codk53u4Rnmt0KrOklYMDOpEBFC_yb_1tlmCkf8QC3gWgNTwIOHU9GDc3Zg6-_-Cu-1FpAeaZOUU4P-HJvC1xSmnMZ0jEc_ZDZZxeuRxk5BccWgt9A-qhvQMxGY3jqcyUdD3taaqzJ_JfsaiBHTk1mrW7IpVJsfVMeNcMZCoV2mI7t8AHh74L2WyTIJFRAOZFPdNLD=w3580-h1150-s-no-gm?authuser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Yx70a2nV8JDdmopKW3f3K5CTmZwBHDgvHDoYYclakT8uqbVW8-LgHKsoy4LqCIGA725D0aaURINPI8GKwtMAvTO_DEcyVr9tg_47J7S9jWEALcosrggSJr9_6MSMd9JLW26UVIKg3-h7_SEel2maAFaFQxClNhCzpOFoesrfLC0-W7eRNT-nbUeP2IccFoEnd88ZjAeiWDcSuAydcEmlEQAfX_6MdKaDB3t8CVq_iDoI9ejx-9sS7LnXrQUqfypMdo8fsXnvAH6Cm4HsOPXcUf88z2I5uWs8WMyGyKwfGvrgOKUx1F3i43FHUIFlPfNCb4DcwJicCMzXsSttaFoViaKNObC8IjYNdElJ2EFeRQ6fwQ0QdvVjs-G6e5qojLczmQheiwnvwfwDYYxRvBMvIbKrrPtk7BbxmxWtZNEQTZ38FYVp0sJzZgSgdcscXuCGzxJOlHl5ezGuSoaveeNOfwUcnt1UdwbIY5k532csFKinxq3By4bdBqQv7Fi3VPj--UywcofES6oGKwqwcrO79xBg9FIhcboEQ588zQJjrvXrsbfPp6qv9m2HE9S3glUvjmq66F4z1SdJVtMj3OHsYdu4K3zdVKynrutGbrtuCaz5eVIgAkO0CTJ5O_Wkch3XmvQNlW6xf_cuU7kSPpPHDf1BdRvBPzpKNGb7d4wf2kEwUTRGLhQaj6qh-jImuQ3XeA2cfEapc9Hp93lr=w3580-h1382-s-no-gm?authuser=2'
|
49 |
]
|
50 |
|
51 |
example_previews = [
|
|
|
68 |
sr_model = models.sd2_sr.load_model(device='cuda:1')
|
69 |
sam_predictor = models.sam.load_model(device='cuda:0')
|
70 |
|
71 |
+
inp_model = inpainting_models[list(inpainting_models.keys())[0]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
def set_model_from_name(inp_model_name):
|
|
|
73 |
global inp_model
|
|
|
|
|
|
|
|
|
|
|
74 |
print (f"Activating Inpaintng Model: {inp_model_name}")
|
75 |
inp_model = inpainting_models[inp_model_name]
|
|
|
76 |
|
77 |
|
78 |
def rasg_run(use_painta, prompt, input, seed, eta, negative_prompt, positive_prompt, ddim_steps,
|
|
|
159 |
negative_prompt='', positive_prompt=', high resolution professional photo'):
|
160 |
torch.cuda.empty_cache()
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
seed = int(seed)
|
163 |
img_index = int(img_index)
|
164 |
|
|
|
208 |
|
209 |
if on_huggingspace:
|
210 |
gr.HTML("""
|
211 |
+
<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to the suggested GPU in settings.
|
212 |
<br/>
|
213 |
<a href="https://huggingface.co/spaces/PAIR/HD-Painter?duplicate=true">
|
214 |
<img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
|
|
|
223 |
with gr.Column():
|
224 |
model_picker = gr.Dropdown(
|
225 |
list(inpainting_models.keys()),
|
226 |
+
value=list(inpainting_models.keys())[0],
|
227 |
label = "Please select a model!",
|
228 |
)
|
229 |
with gr.Column():
|
|
|
233 |
prompt = gr.Textbox(label = "Inpainting Prompt")
|
234 |
with gr.Row():
|
235 |
with gr.Column():
|
236 |
+
input = gr.ImageMask(label = "Input Image", brush_color='#ff0000', elem_id="inputmask", type="pil")
|
237 |
|
238 |
with gr.Row():
|
239 |
inpaint_btn = gr.Button("Inpaint", scale = 0)
|