Spaces:
Building
on
A10G
Building
on
A10G
app.py
CHANGED
@@ -143,7 +143,8 @@ def predict(
|
|
143 |
)
|
144 |
|
145 |
rgb_img = tensor_to_pil(vaedecode_sample[0])
|
146 |
-
return
|
|
|
147 |
else:
|
148 |
layereddiffusionapply_sample = ld_fg_apply_layered_diffusion(
|
149 |
config="SDXL, Conv Injection", weight=1, model=ckpt[0]
|
@@ -181,7 +182,7 @@ def predict(
|
|
181 |
mask = tensor_to_pil(mask[0])
|
182 |
rgb_img = tensor_to_pil(vaedecode_sample[0])
|
183 |
|
184 |
-
return
|
185 |
# return flatten([rgba_img, mask, rgb_img, ld_image])
|
186 |
except Exception as e:
|
187 |
raise gr.Error(e)
|
@@ -200,9 +201,6 @@ def predict_examples(
|
|
200 |
seed=-1,
|
201 |
cfg=10,
|
202 |
):
|
203 |
-
print(
|
204 |
-
"RUUNING EXAMPLES", prompt, negative_prompt, input_image, remove_bg, cond_mode
|
205 |
-
)
|
206 |
return predict(
|
207 |
prompt,
|
208 |
negative_prompt,
|
@@ -225,7 +223,8 @@ css = """
|
|
225 |
"""
|
226 |
with gr.Blocks(css=css) as blocks:
|
227 |
gr.Markdown("""# LayerDiffuse (unofficial)
|
228 |
-
|
|
|
229 |
""")
|
230 |
|
231 |
with gr.Row():
|
@@ -282,8 +281,10 @@ with gr.Blocks(css=css) as blocks:
|
|
282 |
label="Denoise", value=1.0, minimum=0.0, maximum=1.0, step=0.01
|
283 |
)
|
284 |
|
285 |
-
with gr.Column(
|
286 |
-
|
|
|
|
|
287 |
|
288 |
inputs = [
|
289 |
prompt,
|
@@ -298,7 +299,7 @@ with gr.Blocks(css=css) as blocks:
|
|
298 |
cfg,
|
299 |
denoise,
|
300 |
]
|
301 |
-
outputs = [
|
302 |
|
303 |
gr.Examples(
|
304 |
fn=predict_examples,
|
|
|
143 |
)
|
144 |
|
145 |
rgb_img = tensor_to_pil(vaedecode_sample[0])
|
146 |
+
return (rgb_img[0], None, seed)
|
147 |
+
|
148 |
else:
|
149 |
layereddiffusionapply_sample = ld_fg_apply_layered_diffusion(
|
150 |
config="SDXL, Conv Injection", weight=1, model=ckpt[0]
|
|
|
182 |
mask = tensor_to_pil(mask[0])
|
183 |
rgb_img = tensor_to_pil(vaedecode_sample[0])
|
184 |
|
185 |
+
return (rgba_img[0], mask[0], seed)
|
186 |
# return flatten([rgba_img, mask, rgb_img, ld_image])
|
187 |
except Exception as e:
|
188 |
raise gr.Error(e)
|
|
|
201 |
seed=-1,
|
202 |
cfg=10,
|
203 |
):
|
|
|
|
|
|
|
204 |
return predict(
|
205 |
prompt,
|
206 |
negative_prompt,
|
|
|
223 |
"""
|
224 |
with gr.Blocks(css=css) as blocks:
|
225 |
gr.Markdown("""# LayerDiffuse (unofficial)
|
226 |
+
Using ComfyUI building blocks with custom node by [huchenlei](https://github.com/huchenlei/ComfyUI-layerdiffuse)
|
227 |
+
models: [LayerDiffusion/layerdiffusion-v1](https://huggingface.co/LayerDiffusion/layerdiffusion-v1/tree/main)
|
228 |
""")
|
229 |
|
230 |
with gr.Row():
|
|
|
281 |
label="Denoise", value=1.0, minimum=0.0, maximum=1.0, step=0.01
|
282 |
)
|
283 |
|
284 |
+
with gr.Column():
|
285 |
+
image = gr.Image()
|
286 |
+
with gr.Accordion(label="Mask", open=False):
|
287 |
+
mask = gr.Image()
|
288 |
|
289 |
inputs = [
|
290 |
prompt,
|
|
|
299 |
cfg,
|
300 |
denoise,
|
301 |
]
|
302 |
+
outputs = [image, mask, curr_seed]
|
303 |
|
304 |
gr.Examples(
|
305 |
fn=predict_examples,
|