Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,9 +46,9 @@ def get_prompts_from_image(image_id):
|
|
| 46 |
if response.status_code == 200:
|
| 47 |
data = response.json()
|
| 48 |
result = data['result']['data']['json']
|
| 49 |
-
if "prompt" in result['meta']:
|
| 50 |
prompt = result['meta']['prompt']
|
| 51 |
-
if "negativePrompt" in result['meta']:
|
| 52 |
negative_prompt = result["meta"]["negativePrompt"]
|
| 53 |
|
| 54 |
return prompt, negative_prompt
|
|
|
|
| 46 |
if response.status_code == 200:
|
| 47 |
data = response.json()
|
| 48 |
result = data['result']['data']['json']
|
| 49 |
+
if result['meta'] is not None and "prompt" in result['meta']:
|
| 50 |
prompt = result['meta']['prompt']
|
| 51 |
+
if result['meta'] is not None and "negativePrompt" in result['meta']:
|
| 52 |
negative_prompt = result["meta"]["negativePrompt"]
|
| 53 |
|
| 54 |
return prompt, negative_prompt
|