Sergidev commited on
Commit
3c21e52
·
verified ·
1 Parent(s): a3faa51

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +2 -3
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', 'seed', 'width', 'height', 'guidance_scale', 'num_inference_steps', 'sampler']
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")