(self, inputs)
| 423 | "The input to this tool should be a comma separated string of two, " |
| 424 | "representing the image_path and the user description. ") |
| 425 | def inference(self, inputs): |
| 426 | image_path, instruct_text = inputs.split(",")[0], ','.join(inputs.split(',')[1:]) |
| 427 | image = Image.open(image_path) |
| 428 | self.seed = random.randint(0, 65535) |
| 429 | seed_everything(self.seed) |
| 430 | prompt = f'{instruct_text}, {self.a_prompt}' |
| 431 | image = self.pipe(prompt, image, num_inference_steps=20, eta=0.0, negative_prompt=self.n_prompt, |
| 432 | guidance_scale=9.0).images[0] |
| 433 | updated_image_path = get_new_image_name(image_path, func_name="line2image") |
| 434 | image.save(updated_image_path) |
| 435 | print(f"\nProcessed LineText2Image, Input Line: {image_path}, Input Text: {instruct_text}, " |
| 436 | f"Output Text: {updated_image_path}") |
| 437 | return updated_image_path |
| 438 | |
| 439 | |
| 440 | class Image2Hed: |
nothing calls this directly
no test coverage detected