from ai_museum Record of the birth of ai_museum
2022-09-07 (private: [/mitoujr/Stable Diffusion#6317738aaff09e00000841ba](https://scrapbox.io/mitoujr/Stable Diffusion#6317738aaff09e00000841ba)) Iām running it on a WSL on a gaming PC (Windows) and Iāve added Dropbox to the host OS so that the generated images go into Dropbox.
- The prompts are also read from a file in Dropbox.
- It automatically reloads when the seed is incremented, so if you write a prompt appropriately and leave it alone, a picture will grow, farming style.
- Iām not sure if I should write an application to tile the growths to make them easier to select.
- Iām not sure whether to write it in Python or Node, to be precise.
2022-09-08 (private /mitoujr/workroom2022-09-08)
1:00
- I want to display a list of AI-generated images.
- I decided to do it with Next.js.
- We decided that writing server-side code in TypeScript and writing client-side code in Python (which is not possible, so we will use it with JS) would benefit from the formerās know-how in the future.
- I named it ai_museum.
- Iām trying to figure out how to see the filesystem from Node.
fs.readdirSync
- File system | Node.js v18.8.0 Documentation
- The file list was taken.
- Find out how to static serve images
- Itās local only, so you can either symlink to Dropbox in public
- Itās done.
- Now, letās look at the image list as a result of hitting the APIā¦
- Oh, fetch is asynchronous, so it would be Promise.
- Or you can hit it with useEffect and update it.
- I decided to do it with Next.js.
3:00
- succession
- The list of images in one folder now appears.
- Why do they line up verticallyā¦
- It was the flex-direction: column.
- I wonder how they were supposed to be lined up so tightlyā¦
- flex-wrap or
- I can now click to zoom in and out.
- Next is the expansion display when there is a āfolder within a folderā.
- Passing parameters to the API isā¦ ts
- The list of images in one folder now appears.
- then it will be in `req.body.folder`, which is convenient!
- [/nishio/Unexpected token o in JSON](https://scrapbox.io/nishio/Unexpected token o in JSON)
- Oh, I'll have to repeat this, I'll have to hit the API asynchronously, I don't know what to do.
- Promise.all solves the problem.
23:00
- Clicked images are now enlarged in a modal dialog.
- I want to display prompt info here, etc.
- Iāve changed the way I store data several times, so what to doā¦
- Thereās fs.exists, letās see if we can determine that.
- deprecated
- There is a fs.existsSync(path)
- Itās done.
- Add the ability to move reviewed images.
- fs.rename
- I wrote it onClick on the client side and it didnāt work, thatās right.
- So you just put an API on it.
- Itās done.
- I want to display prompt info here, etc.
- The images in the subfolder are tiled like this
- Clicking on the button displays detailed information in a modal, and pressing āexcellent!ā here moves the file to a folder with good images.
- The test user (my wife) has gone to bed, so Iāll continue tomorrow.
chit-chat
- Today I learned
- I wondered if I should write a tool that runs locally to help sort images in Python, which Iām used to for file processing and such, and use HTML+JS for the UI, or do Next.js in TypeScript, but the conclusion Next.js was super useful.
- UI part can be easily created with Reactās JSX.
- The API part is also just copying and increasing the sample files in the API folder.
- It works without having to write routing or anything.
- File manipulation systems, the ones in Python are usually in Node, too, and are called Sync.
This page is auto-translated from /nishio/ai_museumčŖēć®čØé² using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. Iām very happy to spread my thought to non-Japanese readers.