Copied from Photoshot, an open-source AI avatar generator web app
- ▲ Next.js for webapp
- 🖼 Chakra UI for UI components
- 🧠 Replicate, a platform for running machine learning models in the cloud
- 💰 Stripe for payments
- 👩🎨 Stable Diffusion an open-source text-to-image generation model
Install dependencies:
yarn install
Setup environment variables:
cp .env.example .env.local
First, run the development server:
npm run dev
# or
yarn dev
Let's figure out the 'MVP List' that we want to complete by x date.
- Homepage
- General UI Colors should change for the homepage.
- Phrases need to be changed, there shouldn't be a "typing" input suggestion thing, even though it is neat.
- Change the "1,2,3" steps to be a idk more clear somehow
- The boxes can stay the same at the bottom, but clean up what they say.
- Navbar
- Display the "tokens" they have.
- Dashboard link
- Log out / Log in
- Login / Sign in page
- Purchase Token Page
- Explain what tokens do
- First time buyer discount
- buy more tokens
- Dashboard
- 2 "Phases"
-
- If there are NO "studios", then we show the "create new studio" page
-
- Otherwise, we should only the studios + a button on top that says "Create new studio"
-
- 2 "Phases"
- Upload
- Upload photos + subject name + type of jubject (create studio in db)
- Studio "Overview" component
- refactor this flow
- Studio Page
- When studio is being "trained", we need a "waiting" message.
- Send notification? (MVP ???)
- "Generate Image" prompt at the top
- Photo example of any filter that has been used to generate an image. (so that can easily see previous results)
- Whatever flow that page is
- When studio is being "trained", we need a "waiting" message.
- Backend
- Way to save the "prompts" for each "filter"
- Include a version of the prompt so they can't change? Or just a new id?
Open http://localhost:3000 with your browser to see the result.
-
Change how credits work.
- "Starter Pack" $10 for 15 credits, otherwise it's $10 for 10 credits.
- Credit Worth
- 1 credit per "10x 512x512 images" generated by a "filter"
- 5 Credits = New Studio to model a new subject.
- 1 Credit to upscale the image.
- Create some sort of referral system?
-
Create UI system for purchasing credits, buying a studio, and generating images.
-
Clean up the current dashbaord ui.
- Add a "New Studio" button instead of the random drag and drop thats just hanging out there.
- Have some sort of "Studio" card that shows the subject, and images generated at a glance. Can be really small grid of them, but it would be pretty neat.
-
General UI Colors should change for the homepage.
- Phrases need to be changed, there shouldn't be a "typing" input suggestion thing, even though it is neat.
- Change the "1,2,3" steps to be a idk more clear somehow
- The boxes can stay the same at the bottom, but clean up what they say.
-
Studio Page
- When they click into the studio it needs to be sleek af. We should have preloaded all of their images the second they logged in, and/or cached them.
- We want the "create" or "generate" new image button at the top and that needs to be the first and main thing they see. We want them generating brand new things every time.
- Generation will be really similar to ProfilePicture.ai websites style selection where it shows what the image could look like and it's just the title of the filter. Behind the scenes it sends the prompt in the background.
- Generation should be dead simple. Click the filter. Click "Create". Get a modal that says "this cost 1 credit" and then they can click create and it goes.
- We should enable "1-click" generation too. It could be a small check-mark next to the "create" button that says "always approve credit spend" that way the modal doesn't have to pop up. Should this be default or opt in?
- Have a note for how many new filters since they last created an image to entice them to create a new image.
- Show neat examples of filters they haven't tried just as an eye catching thing.
- There needs to be a way to upscale the images by clicking a button and paying for it.
- This should also have the "1-click" check box.
- There should be a UI for all of their purchased upscaled images.
- We also need a quick way for the user to purchase prints of these images. The faster thy can purchase it the better. Though I wonder if that will be a separate thing from the "credits" system.
- The 'name' of the studio should have no bearing on the "token" that we generate to use for the prompts. We want that to be saved separately so it's easier for the user.
-
prompt generator - https://huggingface.co/succinctly/text2image-prompt-generator?text=A+photo+of+sks+dog
-
prompt inspiration = https://lexica.art/
Test 1
- Changing to "constant"
- Add 20 pictures of Teddy doing things
- Add the 2020 steps, and whatever other pieces needed.
- Check how many of these we need: num_class_images = 200, lr_scheduler= constant
- save_interval = 400
- save_sample_prompt:
a ${project.instanceName} ${instanceClass} wearing a red hat
, - Skip the regularization images for now.
Test 2
- Add regularization images to the training set
class_data
for 'dog'- Can I add regularization images for multiple different classes?
- It seems these should be generated from the ai, and like 1500+ of them. You want them doing a variety of things to narrow down the
class
for the ai.
Bugs / Improvements:
- Check if the images are being cropped correctly, and set to 512 or not.
- Open the studio and see all the details used to build this studio, including images.
- Let user zoom in on photo correctly
- Let user press 'x' to delete image they don't want before they upload it.
- Set image size limits + file types
- Under "My Studios" under "unlock now" button the images don't load.
- Enforce certain image files, unsure what they are but need to look.
- Set different buckets for the initial upload of photos, and the final output of the model. This will allow us to delete the initial bucket after the model is trained.
Replicate Client:
- Actually split out the replicate API calls to the replicate class so we can call it easier.
Dreambooth:
-
We should also flip the images to the opposite view as this allows us to double the training for free.
-
Setup the webhook completion. See:
webhook_completed
in `api/projects/[id]/train. -
Also create a cool builder tool for them to add their own templates. Throw that under customization or something paid.
Change naming conventions:
studio
tomodel
shot
toimage
photoshot
to idk yet
Need to set up Domain and DNS records before we can send emails
- Use sendgrid once we have a domain name
- Create business name, and LLC? kms
- Decide on App name
Setup Stripe Pricing:
- Under api/checkout/session stripe lists the product descriptions, we will need to change those.
- Once we determine "Credits" that should also be added to api/projects/index fetch where we create the entry with 'credits' set to 50.
- NEXT_PUBLIC_STRIPE_STUDIO_PRICE= Set to $14.99 for now.
- NEXT_PUBLIC_STUDIO_SHOT_AMOUNT= Set to max of 50 for now.
Security:
- Add row level security to the database's storage so people can't alter things!
- There are under storage/policies in supabase
- We need to only allow users to view their own bucket
Replicate "train" modelStatus will have statuses "starting" of "pushing", and "succeeded"