(self, inputs)
| 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 | |
| 554 | class Image2Pose: |
nothing calls this directly
no test coverage detected