Spaces:
Runtime error
Runtime error
Update utils.py
Browse files
utils.py
CHANGED
@@ -96,7 +96,7 @@ def is_google_colab():
|
|
96 |
def validate_json_parameters(json_str):
|
97 |
try:
|
98 |
params = json.loads(json_str)
|
99 |
-
required_keys = ['prompt', 'negative_prompt', '
|
100 |
for key in required_keys:
|
101 |
if key not in params:
|
102 |
raise ValueError(f"Missing required key: {key}")
|
@@ -112,5 +112,4 @@ from io import BytesIO
|
|
112 |
def image_to_base64(image):
|
113 |
buffered = BytesIO()
|
114 |
image.save(buffered, format="PNG")
|
115 |
-
return base64.b64encode(buffered.getvalue()).decode("utf-8")
|
116 |
-
|
|
|
96 |
def validate_json_parameters(json_str):
|
97 |
try:
|
98 |
params = json.loads(json_str)
|
99 |
+
required_keys = ['prompt', 'negative_prompt', 'resolution', 'guidance_scale', 'num_inference_steps', 'seed', 'sampler']
|
100 |
for key in required_keys:
|
101 |
if key not in params:
|
102 |
raise ValueError(f"Missing required key: {key}")
|
|
|
112 |
def image_to_base64(image):
|
113 |
buffered = BytesIO()
|
114 |
image.save(buffered, format="PNG")
|
115 |
+
return base64.b64encode(buffered.getvalue()).decode("utf-8")
|
|