@levelsio Profile picture
Oct 4, 2022 16 tweets 5 min read Read on X
Here's how I built from scratch in 5 days: interiorai.com



Image
Image
Image
Image
It's all handwritten vanilla HTML, with vanilla CSS (in the same page), vanilla JS with jQuery, it sends jQuery ajax() requests to the server which runs PHP to upload your photo, and then PHP talks to Python to generate the pics with Stable Diffusion!
The difficulty for me was here:
- it takes anywhere from 3 to 30 seconds to generate an image (mostly depending on SD step count)
- client clicks [ GENERATE ], it sends ajax(), server then needs to start generating the pic, and send it back
- this WOULD keep a PHP process running for those 3 to 30 seconds, which worked if it was just me, but if it was 100-300 people on the site (like yday) at 120 generated per minute, it'd break quickly

So...
As I like to do things manually, I built my own mini queue system:
1) when client clicks [ generate ], server puts the job in db (SQLite)
2) a PHP script that runs constantly (I call it a worker) checks the db for new jobs, takes one, sets it as processing, and starts gen img
3) I set 10-20 of the same PHP worker script to run in parallel, it's just a while(1) loop and loops forever, until the script is changed or after 24h to reset
4) a cron starts it every 1 minute, if it's already running it doesn't start
5) meanwhile the client polls server for result (is the image done yet?), it does this by opening a JSON file with the image id, this is because if it'd hit PHP every time it'd be heavy, just hitting static JSON file only hits NGINX which is fine
6) the JSON file has the images generated, in this case only 1, but before I'd gen 4, anyway the JSON file not 404'ing means the image is ready and the JS then loads the image
This queue system was fastest for me to build instead of learning new stuff with WebSockets and parallel stuff which long term I can/will switch to IF the product idea is validated and makes money!
The other challenge was getting the interiors to look well, Stable Diffusion has lots of parameters to tweak like cfg_scale, steps count, image strength, actually funnily enough I learnt LESS steps not more is better for me and also cheaper
Some things I am working on next:
- improving that AI doesn't change the walls of the room
- adding object detection and product links (not sure if I can but try)
- adding an eraser tool so you can brush out stuff you don't like from your room or the render and re-generate
I got lots of inspiration in the design esp from stockai.com by @dannypostmaa and playgroundai.com by @Suhail and from promptomania.com/prompt-builder/ (esp the image boxes for styles) and @faceapp_ai with the face styles in the bottom!
Thanks @stabilityai and @EMostaque for building Stable Diffusion and helping me find init_image in the API
Oh and forgot I had to buy the domain too which wasn't cheap for $2899
And forgot next step is of course:
- add Stripe Checkout and sell Pro memberships
It was quite an intense 5 days, I skipped gym the last 3 days, was coding like crazy, but went again today, really fun to dive in to new project though <3

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with @levelsio

@levelsio Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @levelsio

Apr 27
How I get 100% perfect sleep:

- very cold bedroom 18-20°C / 64-68°F (colder better)
- 9kg weighted blanket by CURA (adjust to your bodyweight)
- separate duvet from gf (I do this for years this might be the biggest sleep improvement)
- 3M ear plugs (I tried Ohropax wax but they only half as silent)
- eye mask
- red LED lights that go on before sleep in bedroom
- 0.2mg melatonin 45min before sleep then dim the lights (melatonin is ALWAYS sold in too high dose like
3mg, it should be 10x less or it doesn't work!)
- 4x per week cardio + strength training, my resting heart rate (RHR) is 52
- mostly clean diet of meat + vegetables + fruit + black coffee + sparkling water with lemon (and sometimes cheat with dark choco), not a lot of carbs (almost never pasta or regular potatoes for ex but sometimes rice or sweet potatoes)
- healthy biomarkers and body mass index, if you're overweight it WILL affect your sleep usually with sleep apnea etc
- read phone before sleep but with Smart Invert on and my custom super dark hack using iOS Zoom (but it doesn't zoom it just decreases brightness even further), then read Kindle a bit to really make me sleepy 😂
- we try avoid eating after 10pm, and we sleep around midnight to 1am, especially sweet stuff like fruits seem to have a bad effect on my sleep
- also DO not drink 2-3 hours before sleep or you wake up to go pee (which is more common when you get older)
- disclaimer: no kids (yet) so easy talking

Other things:

Temperature seems to be the biggest impact for me, if it gets too hot I wake up and once I wake up my brain gets active and it's sometimes hard to fall asleep. I already had this years ago and thought it was stress but even if I have life stuff going along I can sleep solid 8h without waking up if it's just a very cold bedroom.

If it's really super cold like 17-18°C / 62-64°FI just never wake up

For that you need a thick duvet though and your gf needs thicker cause women are generally colder

If you're culturally used to sleeping hotter, consider changing that because it seems to benefit almost anyone to sleep colder! An AC will do the trick.

As @bryan_johnson tells everyone, sleep is the most important thing to prioritize for your health

Good sleep benefits all your health markers, your immune system and so stops you from getting sick. Even cleaning your brain of plaque to avoid dementia when you're olderImage
I always forget stuff but yes
- exterior electric black out blinds so it's completely dark except for a tiny bathroom light
Oh and
- no alcohol and drugs

With few times per year exceptions ;)
Read 4 tweets
Aug 24, 2024
My new theory is when Jesus turned 12 he went to travel eastwards from Jerusalem to Asia

There he discovered and studied Hinduism/Buddhism for a decade

Then at age 30 he returned to Jerusalem, forked Judaism, added the Hindu/Buddhist concepts to it and that became Christianity
Image
The period from age 12 to 30 in Jesus life is somehow not described anywhere

He just showed up at 30 and did his thing

Most concepts Jesus preached seem to overlap strongly with Buddhism and even more with Hinduism like compassion, love your neighbors and enemies, detachment from materialism, treat others how you'd like to be treated (karma) etcImage
Image
Image
Image
What's interesting is that Islam itself is a 500 year later fork of Christianity and Jesus is a non-holy prophet in the Qu'ran

So if that's true and you keep going back the origins of most religions may just be Hinduism and Judaism

Buddhism itself was a fork of Hinduism too
Read 5 tweets
Jul 27, 2024
I think AI hype/bubble won't pop yet until we have full photorealistic video and 3d

Photorealistic images already takes way more GPU than an LLM

And video and 3d is be a multiple of that GPU power

We are very close to dynamically generated real-time immersive 3d worlds Image
Everyone's so deadstared into LLMs

I've always felt people completely underestimate / do not pay enough attention to AI imaging

Maybe because it's only recently leaving uncanny valley

Once it does that might be next to get all the attention again

And these immersive 3d worlds will compete with video games I think
Read 6 tweets
Mar 27, 2024
So last year @Wayfair, an $8B company, launched their own AI interior design tool

This week someone at Wayfair asked me to cancel their subscription of , which is my AI interior design tool launched 2 years ago

I was confused why would they sign up to it if they have their own? Well, because they signed up to it before they had their own and used it to build their version of it! 😂

They had 8 different accounts on Interior AI that ran for months 🤯

I learnt a bit about competitive spying today!

Told ya the big companies were checking what indie hackers did, that was my entire point when I said "indie hacking is dead", we're part of the big market now where billion dollar companies are INSIDE our apps!InteriorAI.comImage
Image
Image
If I did competitive spying I'd at least use a different domain name though, not my own company @wayfair.com
P.S. it's all good, I think it's even legal, just kinda funny a big billion dollar company is INSIDE MY APPS!
Read 4 tweets
Sep 2, 2023
Any statistical way to solve this?

I test parameters on Photo AI on a % of photos taken

Then I check what % of photos are ❤️ favorited

Based on that I can figure out what parameters is better on 700,000 photos taken per month

But sometimes you get 1 or 2 users ❤️ favoriting lots of photos with one specific parameter which affects the data and makes one parameter choice come out as a winner when actually it's just a few users doing it

Any stat solution for this?
Right now my SQL is smth like this

SELECT upscale_strength,count(upscale_strength) as cnt FROM photos WHERE upscale_strength IS NOT NULL AND (saved IS NOT NULL) GROUP BY upscale_strength ORDER BY cnt DESC LIMIT 10
I can add count(distinct(user_id)) for ex:

SELECT upscale_strength,count(upscale_strength) as cnt,count(distinct(user_id)) FROM photos WHERE (saved IS NOT NULL) GROUP BY upscale_strength ORDER BY cnt DESC LIMIT 10 Image
Read 6 tweets
Jul 30, 2023
Biggest benefit you have starting out in anything is being a noob and not knowing anything

If you’d share that true honest story it’s super authentic and people love to hear that

But nobody does

Instead I see people on social media faking being succesful with 100 followers
I never understand why people on here aren’t being more radically honest and transparent about their life and work and business situation

Easiest way to get people interested in you because EVERYBODY is still too scared to do it

Way more engagement than being another threadboi… twitter.com/i/web/status/1…
I was already tweeting whatever I did and thought and made 10 years ago when it got 2 likes

Nothing much changed except now ppl listen to it more
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(