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

Method inference

visual_chatgpt.py:291–298  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

289 "like: generate an image of an object or something, or generate an image that includes some objects. "
290 "The input to this tool should be a string, representing the text used to generate image. ")
291 def inference(self, text):
292 image_filename = os.path.join('image', f"{str(uuid.uuid4())[:8]}.png")
293 prompt = text + ', ' + self.a_prompt
294 image = self.pipe(prompt, negative_prompt=self.n_prompt).images[0]
295 image.save(image_filename)
296 print(
297 f"\nProcessed Text2Image, Input Text: {text}, Output Image: {image_filename}")
298 return image_filename
299
300
301class ImageCaptioning:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected