Skip to content

sebrock/stablecog

 
 

Repository files navigation

Stablecog - Simple, free & open source AI image generator

GitHub top language GitHub code size in bytes GitHub Discord

This is an app for creating AI generated images using Stable Diffusion cogs. It's made with SvelteKit, uses Supabase for recording of metadata and for managing the default cog cluster. For more info on "cogs", you can check out: Replicate. The app is hosted at stablecog.com.

Stablecog Home (Default + Dark Mode)
Home (Default + Dark Mode)
Stablecog Home (Advanced + Light Mode)
Home (Advanced + Light Mode)
Stablecog Gallery
Gallery
Stablecog Live
Live

The app knows how to communicate with this cog to generate images: Stable Diffusion Cog. It is available on Docker Hub at: yekta/sc. However, as long as your server has the endpoints and the parameters the app uses, it'll work.

For example, the following cogs would also work with the app:

For the app to work, the cog needs to have the following input properties on the /predictions endpoint:

  • prompt, width, height, guidance_scale, num_inference_steps, seed.

Optionals:

  • negative_prompt

Running the app in development mode

First, install the dependencies with:

npm install

Then, you can run the app in development mode with:

npm run dev

Running the app in production mode

First, create a production version of the app:

npm run build

Then, you can start the app in production mode with:

node ./build

If you want to deploy the app, you should edit or remove the ci.yml file in .github/workflows to suit your setup. There is also a kubernetes folder with the config files to deploy on Kubernetes but those are again specific to my setup, so you can edit, remove or ignore those.


Optionals

There is a .env.example file in the root directory. You can copy this file and rename it to .env. This will allow you to set the following optional environment variables:

  • PUBLIC_DEFAULT_SERVER_URL: This is the default server url (your cog's url) that the app uses to generate images if provided. You can still change to another server in the app by clicking the settings icon in the top right corner of the home page.

In case you want to record generation metadata, you can use a Supabase instance. You can set the following environment variables to enable it:

  • PUBLIC_SUPABASE_URL: The url of your Supabase instance.
  • PUBLIC_SUPABASE_ANON_KEY: The anon key of your Supabase instance.
  • PUBLIC_SUPABASE_ADMIN_KEY. The admin key of your Supabase instance.

Special Thanks

Mahdi has been contributing by providing two NVIDIA A40s which are being used for the default cog cluster. Thanks to his contribution, thousands of people generated 150K+ images (so far) for free, without seeing any ads or dealing with sign ups.

Following people have contributed by translating the app to their language. Thanks to their contributions, billions of people can use the app in their native language:

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 50.9%
  • Svelte 46.5%
  • HTML 0.9%
  • CSS 0.8%
  • JavaScript 0.7%
  • Dockerfile 0.2%