| | |
| | | self._add_content_to_doc(doc,"text",para) |
| | | if random.random() > 0.5: |
| | | try: |
| | | img_stream = self.text2imager.generate_image_to_stream(para) |
| | | img_stream = self.text2imager.generate_image_with_trans_to_stream(para) |
| | | self._add_content_to_doc(doc,"image",img_stream) |
| | | except: |
| | | pass |
| | |
| | | |
| | | self.summary_info = self._summarize_title_intro_keywords() |
| | | print(self.summary_info) |
| | | self.text2imager.generate_image(self.summary_info["description"],output_path.replace(".docx",".png")) |
| | | self.text2imager.generate_image_with_trans(self.summary_info["description"],output_path.replace(".docx",".png")) |
| | | self.summary_info["path_cover"] = output_path.replace(".docx",".png") |
| | | |
| | | |