zenafey commited on
Commit
52c345e
·
1 Parent(s): e3d2f9e

Update engine.py

Browse files
Files changed (1) hide show
  1. engine.py +15 -1
engine.py CHANGED
@@ -31,6 +31,10 @@ class Prodia:
31
  response = self._post(f"{self.base}/sdxl/generate", params)
32
  return response.json()
33
 
 
 
 
 
34
  def get_job(self, job_id):
35
  response = self._get(f"{self.base}/job/{job_id}")
36
  return response.json()
@@ -158,7 +162,6 @@ def transform_sd(image, model, prompt, denoising_strength, negative_prompt, step
158
 
159
 
160
  def controlnet_sd(image, controlnet_model, controlnet_module, threshold_a, threshold_b, resize_mode, prompt, negative_prompt, steps, cfg_scale, seed, sampler, width, height):
161
- print(image)
162
  image_url = prodia_client.upload(image)
163
  result = prodia_client.sd_transform({
164
  "imageUrl": image_url,
@@ -181,5 +184,16 @@ def controlnet_sd(image, controlnet_model, controlnet_module, threshold_a, thres
181
 
182
  return job["imageUrl"]
183
 
 
 
 
 
 
 
 
 
 
 
 
184
  def get_models():
185
  return prodia_client.list_models()
 
31
  response = self._post(f"{self.base}/sdxl/generate", params)
32
  return response.json()
33
 
34
+ def upscale_image(self, params):
35
+ response = self._post(f"{self.base}/upscale", params)
36
+ return response.json()
37
+
38
  def get_job(self, job_id):
39
  response = self._get(f"{self.base}/job/{job_id}")
40
  return response.json()
 
162
 
163
 
164
  def controlnet_sd(image, controlnet_model, controlnet_module, threshold_a, threshold_b, resize_mode, prompt, negative_prompt, steps, cfg_scale, seed, sampler, width, height):
 
165
  image_url = prodia_client.upload(image)
166
  result = prodia_client.sd_transform({
167
  "imageUrl": image_url,
 
184
 
185
  return job["imageUrl"]
186
 
187
+ def upscale(image, scale_by):
188
+ image_url = prodia_client.upload(image)
189
+ result = prodia_client.upscale_image({
190
+ 'imageUrl': image_url,
191
+ 'resize': scale_by
192
+ })
193
+
194
+ job = prodia_client.wait(result)
195
+
196
+ return job["imageUrl"]
197
+
198
  def get_models():
199
  return prodia_client.list_models()