MiklX commited on
Commit
8c3d303
·
1 Parent(s): 1385bb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -4,16 +4,19 @@ app = Flask(__name__)
4
  @app.route('/api/v1/image', methods=['POST'])
5
  def generate_image():
6
  data = request.get_json()
7
- if 'APIKEY' not in data or 'prompt' not in data or 'userId' not in data:
8
  return jsonify({'error': 'Missing required parameters'}), 400
9
- headers = {'Authorization': data['APIKEY']}
 
10
  post_data = {
11
- 'model': data['ii'],
12
  'prompt': data['prompt'],
13
  'userId': data['userId']
14
  }
15
- print(data['ii'])
16
- response = requests.post('https://api.ddosxd.ru/v1/image', headers=headers, json=post_data)
 
 
17
  print(response.json())
18
  return response.json()
19
  if __name__ == '__main__':
 
4
  @app.route('/api/v1/image', methods=['POST'])
5
  def generate_image():
6
  data = request.get_json()
7
+ if 'apiKey' not in data or 'prompt' not in data or 'userId' not in data:
8
  return jsonify({'error': 'Missing required parameters'}), 400
9
+
10
+ headers = {'Authorization': data['apiKey']}
11
  post_data = {
12
+ 'model': data['model'],
13
  'prompt': data['prompt'],
14
  'userId': data['userId']
15
  }
16
+
17
+ print(data['model'])
18
+
19
+ response = requests.post('https://api.example.com/v1/image', headers=headers, json=post_data)
20
  print(response.json())
21
  return response.json()
22
  if __name__ == '__main__':