Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,20 +12,31 @@ repo_dir = pathlib.Path(__file__).parent
|
|
| 12 |
|
| 13 |
|
| 14 |
def create_demo():
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
model = Model()
|
| 18 |
|
| 19 |
with gr.Blocks(css=repo_dir / 'style.css') as demo:
|
| 20 |
-
gr.Markdown(
|
|
|
|
| 21 |
with gr.Row():
|
| 22 |
with gr.Column():
|
| 23 |
with gr.Box():
|
| 24 |
image = gr.Image(label='Input', tool='sketch', type='pil')
|
| 25 |
-
gr.Markdown('Draw a mask on your object.')
|
|
|
|
| 26 |
prompt = gr.Text(
|
| 27 |
label='Prompt',
|
| 28 |
-
placeholder='e.g. "A photo of S", "S wearing sunglasses"',
|
| 29 |
info='Use "S" for your concept.')
|
| 30 |
lambda_ = gr.Slider(
|
| 31 |
label='Lambda',
|
|
@@ -57,7 +68,7 @@ def create_demo():
|
|
| 57 |
minimum=1,
|
| 58 |
maximum=100,
|
| 59 |
step=1,
|
| 60 |
-
value=
|
| 61 |
info=
|
| 62 |
'In the paper, the number of steps is set to 100, but in this demo the default value is 20 to reduce inference time.'
|
| 63 |
)
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
def create_demo():
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
TITLE = '# [ELITE Demo](https://github.com/csyxwei/ELITE)'
|
| 18 |
+
|
| 19 |
+
USAGE='''To run the demo, you should:
|
| 20 |
+
1. Upload your image.
|
| 21 |
+
2. **Draw a mask on the object part.**
|
| 22 |
+
3. Input proper text prompts, such as "A photo of S" or "A S wearing sunglasses", where "S" denotes your customized concept.
|
| 23 |
+
4. Click the Run button. You can also adjust the hyperparameters to improve the results.
|
| 24 |
+
'''
|
| 25 |
|
| 26 |
model = Model()
|
| 27 |
|
| 28 |
with gr.Blocks(css=repo_dir / 'style.css') as demo:
|
| 29 |
+
gr.Markdown(TITLE)
|
| 30 |
+
gr.Markdown(USAGE)
|
| 31 |
with gr.Row():
|
| 32 |
with gr.Column():
|
| 33 |
with gr.Box():
|
| 34 |
image = gr.Image(label='Input', tool='sketch', type='pil')
|
| 35 |
+
# gr.Markdown('Draw a mask on your object.')
|
| 36 |
+
gr.Markdown(USAGE)
|
| 37 |
prompt = gr.Text(
|
| 38 |
label='Prompt',
|
| 39 |
+
placeholder='e.g. "A photo of S", "A S wearing sunglasses"',
|
| 40 |
info='Use "S" for your concept.')
|
| 41 |
lambda_ = gr.Slider(
|
| 42 |
label='Lambda',
|
|
|
|
| 68 |
minimum=1,
|
| 69 |
maximum=100,
|
| 70 |
step=1,
|
| 71 |
+
value=300,
|
| 72 |
info=
|
| 73 |
'In the paper, the number of steps is set to 100, but in this demo the default value is 20 to reduce inference time.'
|
| 74 |
)
|