(self, text)
| 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 | |
| 301 | class ImageCaptioning: |
nothing calls this directly
no outgoing calls
no test coverage detected