Spaces:
Sleeping
Sleeping
Amit Gazal
commited on
Commit
·
522f227
1
Parent(s):
80d8afe
prevent text in the image
Browse files
app.py
CHANGED
@@ -35,6 +35,7 @@ You are a background editor.
|
|
35 |
Your job is to adjust the background of the image to be in a {{holiday}} vibes, but take into considration the perspective and the logic of the image.
|
36 |
Your output should be a prompt that can be used to edit the background of the image.
|
37 |
The background should be edited in a way that is consistent with the image.
|
|
|
38 |
'''
|
39 |
|
40 |
def image_to_prompt(image: str, holiday: str) -> tuple[str, str]:
|
@@ -121,6 +122,9 @@ def modify_background(image: Image.Image, mask: Image.Image, prompt: str) -> Ima
|
|
121 |
"mask": ("mask.png", mask_bytes, "image/png") # You might want to send a different mask file
|
122 |
}
|
123 |
|
|
|
|
|
|
|
124 |
payload = {
|
125 |
"prompt": prompt, # Use the actual prompt parameter
|
126 |
"model": "V_2",
|
|
|
35 |
Your job is to adjust the background of the image to be in a {{holiday}} vibes, but take into considration the perspective and the logic of the image.
|
36 |
Your output should be a prompt that can be used to edit the background of the image.
|
37 |
The background should be edited in a way that is consistent with the image.
|
38 |
+
The prompt should not include any text or writing in the background.
|
39 |
'''
|
40 |
|
41 |
def image_to_prompt(image: str, holiday: str) -> tuple[str, str]:
|
|
|
122 |
"mask": ("mask.png", mask_bytes, "image/png") # You might want to send a different mask file
|
123 |
}
|
124 |
|
125 |
+
prevent_text_in_background = "Do not include any text or writing in the background."
|
126 |
+
prompt = f"{prompt} {prevent_text_in_background}"
|
127 |
+
|
128 |
payload = {
|
129 |
"prompt": prompt, # Use the actual prompt parameter
|
130 |
"model": "V_2",
|