Spaces:
Sleeping
Sleeping
Update image_gen.py
Browse files- image_gen.py +1 -1
image_gen.py
CHANGED
|
@@ -187,7 +187,7 @@ def generate_image(prompt_text, style, model="hf"):
|
|
| 187 |
headers_pexels = {
|
| 188 |
"Authorization": pexels_api_key
|
| 189 |
}
|
| 190 |
-
new_prompt = model_g.generate_content(f"Generate keywords or a phrase to search for an appropriate image on the pexels API based on this prompt: {prompt_text}")
|
| 191 |
pexel_prompt = str(new_prompt.text)
|
| 192 |
|
| 193 |
search_url = f"https://api.pexels.com/v1/search?query={pexel_prompt}&per_page=1"
|
|
|
|
| 187 |
headers_pexels = {
|
| 188 |
"Authorization": pexels_api_key
|
| 189 |
}
|
| 190 |
+
new_prompt = model_g.generate_content(f"Generate keywords or a phrase to search for an appropriate image on the pexels API based on this prompt: {prompt_text} return only the keywords and nothing else")
|
| 191 |
pexel_prompt = str(new_prompt.text)
|
| 192 |
|
| 193 |
search_url = f"https://api.pexels.com/v1/search?query={pexel_prompt}&per_page=1"
|