MCPcopy Index your code
hub / github.com/chenfei-wu/TaskMatrix / inference

Method inference

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

Source from the content-addressed store, hash-verified

537 "The input to this tool should be a comma separated string of two, "
538 "representing the image_path and the user description")
539 def inference(self, inputs):
540 image_path, instruct_text = inputs.split(",")[0], ','.join(inputs.split(',')[1:])
541 image = Image.open(image_path)
542 self.seed = random.randint(0, 65535)
543 seed_everything(self.seed)
544 prompt = f'{instruct_text}, {self.a_prompt}'
545 image = self.pipe(prompt, image, num_inference_steps=20, eta=0.0, negative_prompt=self.n_prompt,
546 guidance_scale=9.0).images[0]
547 updated_image_path = get_new_image_name(image_path, func_name="scribble2image")
548 image.save(updated_image_path)
549 print(f"\nProcessed ScribbleText2Image, Input Scribble: {image_path}, Input Text: {instruct_text}, "
550 f"Output Image: {updated_image_path}")
551 return updated_image_path
552
553
554class Image2Pose:

Callers

nothing calls this directly

Calls 2

seed_everythingFunction · 0.85
get_new_image_nameFunction · 0.85

Tested by

no test coverage detected