(self, inputs)
| 690 | "The input to this tool should be a comma separated string of two, " |
| 691 | "representing the image_path and the user description") |
| 692 | def inference(self, inputs): |
| 693 | image_path, instruct_text = inputs.split(",")[0], ','.join(inputs.split(',')[1:]) |
| 694 | image = Image.open(image_path) |
| 695 | self.seed = random.randint(0, 65535) |
| 696 | seed_everything(self.seed) |
| 697 | prompt = f'{instruct_text}, {self.a_prompt}' |
| 698 | image = self.pipe(prompt, image, num_inference_steps=20, eta=0.0, negative_prompt=self.n_prompt, |
| 699 | guidance_scale=9.0).images[0] |
| 700 | updated_image_path = get_new_image_name(image_path, func_name="depth2image") |
| 701 | image.save(updated_image_path) |
| 702 | print(f"\nProcessed DepthText2Image, Input Depth: {image_path}, Input Text: {instruct_text}, " |
| 703 | f"Output Image: {updated_image_path}") |
| 704 | return updated_image_path |
| 705 | |
| 706 | |
| 707 | class Image2Normal: |
nothing calls this directly
no test coverage detected