multimodalart HF staff commited on
Commit
6a97eae
1 Parent(s): 83693e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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