mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-09 00:09:55 +00:00
add authentication & checking of feature flag
This commit is contained in:
@@ -2,12 +2,17 @@ import json
|
||||
|
||||
import requests
|
||||
|
||||
url = 'http://localhost:8000/preview/'
|
||||
# url = 'http://207.189.112.61:31605/preview'
|
||||
# url = "http://207.189.112.61:31605/preview"
|
||||
url = "http://localhost:8000/preview"
|
||||
payload = {"style": "paper_origami", "positive_prompt": "test pos in", "negative_prompt": "test neg in"}
|
||||
files = {'input_file': open('test_image.jpg', 'rb')}
|
||||
|
||||
response = requests.post(url, data={'request': json.dumps(payload)}, files=files) # Use 'request': payload directly
|
||||
cookies = {
|
||||
"session": "<put your session cookie here>"
|
||||
}
|
||||
|
||||
response = requests.post(url, data={'request': json.dumps(payload)}, files=files, cookies=cookies)
|
||||
if response.status_code == 200:
|
||||
# Success
|
||||
with open('preview_image.jpeg', 'wb') as f:
|
||||
|
||||
Reference in New Issue
Block a user