Spaces:
Running
on
Zero
Running
on
Zero
update example
Browse files- app.py +1 -1
- example.py +28 -0
app.py
CHANGED
@@ -394,7 +394,7 @@ class ChatBotUI(object):
|
|
394 |
2. Enter '@' in the text box will exhibit all images in the gallery.
|
395 |
3. Select the image you wish to edit from the gallery, and its Image ID will be displayed in the text box.
|
396 |
4. Compose the editing instruction for the selected image, incorporating image id '@xxxxxx' into your instruction.
|
397 |
-
For example, you might say, "Change the girl's skirt in @123456 to blue." The '@xxxxx' token will facilitate the identification of the specific image, and will be automatically replaced by a special token '{image}' in the instruction.
|
398 |
5. Once your instructions are prepared, please click the "Chat" button to view the edited result in the chat window.
|
399 |
6. **Important** To render text on an image, please ensure to include a space between each letter. For instance, "add text 'g i r l' on the mask area of @xxxxx".
|
400 |
7. To implement local editing based on a specified mask, simply click on the image within the chat window to access the image editor. Here, you can draw a mask and then click the 'Submit' button to upload the edited image along with the mask. For inpainting tasks, select the 'Composite' mask type, while for outpainting tasks, choose the 'Outpainting' mask type. For all other local editing tasks, please select the 'Background' mask type.
|
|
|
394 |
2. Enter '@' in the text box will exhibit all images in the gallery.
|
395 |
3. Select the image you wish to edit from the gallery, and its Image ID will be displayed in the text box.
|
396 |
4. Compose the editing instruction for the selected image, incorporating image id '@xxxxxx' into your instruction.
|
397 |
+
For example, you might say, "Change the girl's skirt in @123456 to blue." The '@xxxxx' token will facilitate the identification of the specific image, and will be automatically replaced by a special token '{image}' in the instruction. Furthermore, it is also possible to engage in text-to-image generation without any initial image input.
|
398 |
5. Once your instructions are prepared, please click the "Chat" button to view the edited result in the chat window.
|
399 |
6. **Important** To render text on an image, please ensure to include a space between each letter. For instance, "add text 'g i r l' on the mask area of @xxxxx".
|
400 |
7. To implement local editing based on a specified mask, simply click on the image within the chat window to access the image editor. Here, you can draw a mask and then click the 'Submit' button to upload the edited image along with the mask. For inpainting tasks, select the 'Composite' mask type, while for outpainting tasks, choose the 'Outpainting' mask type. For all other local editing tasks, please select the 'Background' mask type.
|
example.py
CHANGED
@@ -17,6 +17,34 @@ def download_image(image, local_path=None):
|
|
17 |
def get_examples(cache_dir):
|
18 |
print('Downloading Examples ...')
|
19 |
examples = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
[
|
21 |
'Controllable Generation',
|
22 |
download_image(
|
|
|
17 |
def get_examples(cache_dir):
|
18 |
print('Downloading Examples ...')
|
19 |
examples = [
|
20 |
+
[
|
21 |
+
'Facial Editing',
|
22 |
+
download_image(
|
23 |
+
'https://github.com/ali-vilab/ace-page/blob/main/assets/examples/e33edc106953.png?raw=true',
|
24 |
+
os.path.join(cache_dir, 'examples/e33edc106953.jpg')), None,
|
25 |
+
None, '{image} let the man smile', 6666
|
26 |
+
],
|
27 |
+
[
|
28 |
+
'Facial Editing',
|
29 |
+
download_image(
|
30 |
+
'https://github.com/ali-vilab/ace-page/blob/main/assets/examples/5d2bcc91a3e9.png?raw=true',
|
31 |
+
os.path.join(cache_dir, 'examples/5d2bcc91a3e9.jpg')), None,
|
32 |
+
None, 'let the man in {image} wear sunglasses', 9999
|
33 |
+
],
|
34 |
+
[
|
35 |
+
'Facial Editing',
|
36 |
+
download_image(
|
37 |
+
'https://github.com/ali-vilab/ace-page/blob/main/assets/examples/3a52eac708bd.png?raw=true',
|
38 |
+
os.path.join(cache_dir, 'examples/3a52eac708bd.jpg')), None,
|
39 |
+
None, '{image} red hair', 9999
|
40 |
+
],
|
41 |
+
[
|
42 |
+
'Facial Editing',
|
43 |
+
download_image(
|
44 |
+
'https://github.com/ali-vilab/ace-page/blob/main/assets/examples/3f4dc464a0ea.png?raw=true',
|
45 |
+
os.path.join(cache_dir, 'examples/3f4dc464a0ea.jpg')), None,
|
46 |
+
None, '{image} let the man serious', 99999
|
47 |
+
],
|
48 |
[
|
49 |
'Controllable Generation',
|
50 |
download_image(
|