mikavehns / BookGPT

Writes complete books with given paramters, using GPT-3.
MIT License
354 stars 66 forks source link

Add images (generated or research) #5

Open Lyesbcb opened 1 year ago

Lyesbcb commented 1 year ago

Is your feature request related to a problem? Please describe. I would like it to be possible to generate books with images generated from Dalle or images related to the subject found on a free library.

We could add a question during the launch: do you want images?

If the person answers yes then we add images.

For image generation we would take the last x words to generate an image.

To look for an image on a free bookstore we would do a search with the title of the book or we ask gpt3 to tell us directly which image would be good to schematize the subject. (we would add below the image in the final result the link to the source)

Additional context I will try to develop this feature, I will make a pull request!

mikavehns commented 1 year ago

You can write me on discord: MIKA#4664 to discuss this idea further. I already thought about something like this. My approach would be not to generate an image based on the last n words, but let gpt-3 generate a prompt next to each chapter title or paragraph title.

malore350 commented 1 year ago

You can write me on discord: MIKA#4664 to discuss this idea further. I already thought about something like this. My approach would be not to generate an image based on the last n words, but let gpt-3 generate a prompt next to each chapter title or paragraph title.

I made it to summarize every chapter to one sentence and to generate image based on that, but it takes a very long time to actually save it to markdown. Not sure what causes that.

mikavehns commented 1 year ago

You can write me on discord: MIKA#4664 to discuss this idea further. I already thought about something like this. My approach would be not to generate an image based on the last n words, but let gpt-3 generate a prompt next to each chapter title or paragraph title.

I made it to summarize every chapter to one sentence and to generate image based on that, but it takes a very long time to actually save it to markdown. Not sure what causes that.

How are you saving the images in the markdown file?

malore350 commented 1 year ago

You can write me on discord: MIKA#4664 to discuss this idea further. I already thought about something like this. My approach would be not to generate an image based on the last n words, but let gpt-3 generate a prompt next to each chapter title or paragraph title.

I made it to summarize every chapter to one sentence and to generate image based on that, but it takes a very long time to actually save it to markdown. Not sure what causes that.

How are you saving the images in the markdown file?

I use Image.create(), which generates image and returns the link to it. I modified the part where every chapter is added-up into whole book so that after adding every chapter it also added image using the markdown syntax to append links to images [alt text]({link}). Though, I noticed that these links expire pretty fast.

mikavehns commented 1 year ago

Greetings, I apologize for the delayed response. I have been occupied with other tasks. Based on my understanding, the issue may not be related to saving the file, but rather during the generation of the images. However, without the code, I cannot provide a definitive statement.