Spaces:
Runtime error
Runtime error
bram-w
commited on
Commit
·
36c3ba1
1
Parent(s):
0eaa580
editing text
Browse files
app.py
CHANGED
|
@@ -42,7 +42,8 @@ def edict(x, source_text, edit_text,
|
|
| 42 |
|
| 43 |
url = endpoint.url
|
| 44 |
url = url + "/api/edit"
|
| 45 |
-
headers = {
|
|
|
|
| 46 |
"User-Agent": "EDICT HuggingFace Space",
|
| 47 |
"Auth-Token": get_token(),
|
| 48 |
}
|
|
@@ -93,15 +94,15 @@ for dog_i in [1, 2]:
|
|
| 93 |
examples.append([f'square_ims/imagenet_dog_{dog_i}.jpg', 'A dog', f'A {breed}', 0.8, 3])
|
| 94 |
|
| 95 |
|
| 96 |
-
description = 'A gradio demo for [EDICT](https://arxiv.org/abs/2211.12446
|
| 97 |
# description = gr.Markdown(description)
|
| 98 |
|
| 99 |
article = """
|
| 100 |
|
| 101 |
### Prompting Style
|
| 102 |
|
| 103 |
-
As with many text-to-image methods, the prompting style of EDICT can make a big difference. When in doubt, experiment! Some guidance
|
| 104 |
-
* Parallel
|
| 105 |
* Words that will affect the entire setting (e.g. "A photo of " vs. "A painting of") can make a big difference. Playing around with them can help a lot
|
| 106 |
|
| 107 |
### Parameters
|
|
@@ -111,6 +112,7 @@ Both `edit_strength` and `guidance_scale` have similar properties qualitatively:
|
|
| 111 |
|
| 112 |
Usually we find changing `edit_strength` to be enough, but feel free to play around (and report any interesting results)!
|
| 113 |
|
|
|
|
| 114 |
|
| 115 |
Having difficulty coming up with a caption? Try [BLIP](https://huggingface.co/spaces/Salesforce/BLIP2) to automatically generate one!
|
| 116 |
|
|
|
|
| 42 |
|
| 43 |
url = endpoint.url
|
| 44 |
url = url + "/api/edit"
|
| 45 |
+
headers = {### Misc.
|
| 46 |
+
|
| 47 |
"User-Agent": "EDICT HuggingFace Space",
|
| 48 |
"Auth-Token": get_token(),
|
| 49 |
}
|
|
|
|
| 94 |
examples.append([f'square_ims/imagenet_dog_{dog_i}.jpg', 'A dog', f'A {breed}', 0.8, 3])
|
| 95 |
|
| 96 |
|
| 97 |
+
description = 'A gradio demo for [EDICT](https://arxiv.org/abs/2211.12446) (CVPR23)'
|
| 98 |
# description = gr.Markdown(description)
|
| 99 |
|
| 100 |
article = """
|
| 101 |
|
| 102 |
### Prompting Style
|
| 103 |
|
| 104 |
+
As with many text-to-image methods, the prompting style of EDICT can make a big difference. When in doubt, experiment! Some guidance:
|
| 105 |
+
* Parallel *Original Description* and *Edit Description* construction as much as possible. Inserting/editing single words often is enough to affect a change while maintaining a lot of the original structure
|
| 106 |
* Words that will affect the entire setting (e.g. "A photo of " vs. "A painting of") can make a big difference. Playing around with them can help a lot
|
| 107 |
|
| 108 |
### Parameters
|
|
|
|
| 112 |
|
| 113 |
Usually we find changing `edit_strength` to be enough, but feel free to play around (and report any interesting results)!
|
| 114 |
|
| 115 |
+
### Misc.
|
| 116 |
|
| 117 |
Having difficulty coming up with a caption? Try [BLIP](https://huggingface.co/spaces/Salesforce/BLIP2) to automatically generate one!
|
| 118 |
|