MCPcopy Create free account
hub / github.com/chenfei-wu/TaskMatrix / inference

Method inference

visual_chatgpt.py:1268–1279  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

1266 "like: extend the image into a resolution of 2048x1024, extend the image into 2048x1024. "
1267 "The input to this tool should be a comma separated string of two, representing the image_path and the resolution of widthxheight")
1268 def inference(self, inputs):
1269 image_path, resolution = inputs.split(',')
1270 width, height = resolution.split('x')
1271 tosize = (int(width), int(height))
1272 image = Image.open(image_path)
1273 image = ImageOps.crop(image, (10, 10, 10, 10))
1274 out_painted_image = self.dowhile(image, tosize, 4, True, False)
1275 updated_image_path = get_new_image_name(image_path, func_name="outpainting")
1276 out_painted_image.save(updated_image_path)
1277 print(f"\nProcessed InfinityOutPainting, Input Image: {image_path}, Input Resolution: {resolution}, "
1278 f"Output Image: {updated_image_path}")
1279 return updated_image_path
1280
1281
1282

Callers

nothing calls this directly

Calls 2

dowhileMethod · 0.95
get_new_image_nameFunction · 0.85

Tested by

no test coverage detected