GithubHelp home page GithubHelp logo

adamelliotfields / gen Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 243 KB

Stable Diffusion web app | gen.aef.me 🎨

Home Page: https://gen.aef.me

License: MIT License

Dockerfile 0.71% HTML 10.05% JavaScript 7.02% TypeScript 82.07% CSS 0.15%
github-pages stable-diffusion huggingface

gen's Introduction

gen

Open in GitHub Codespaces Open in StackBlitz

My image generation web UI, hosted on GitHub Pages: gen.aef.me

Features

  • Stable Diffusion XL text-to-image via 🤗 Inference API
  • Supports different image sizes, guidance scale, steps, and negative prompt
  • Examples!

TODO

  • Embed mode like JupyterLite REPL
  • Multiple backends (stability.ai, fal.ai, etc)
  • More models
  • Image-to-image tasks
  • API key input

Usage

# install bun
export PATH="${HOME}/.bun/bin:${PATH}"
curl -fsSL https://bun.sh/install | bash

# install deps
bun install

# start the dev server
bun start

Secrets

  • VITE_FAL_URL - Alternate URL (proxy) for the Fal.ai API (default: https://fal.run)
  • VITE_FAL_KEY - Fal.ai API key (default: undefined)
  • VITE_HF_URL - Alternate URL (proxy) for the Hugging Face API (default: https://api-inference.huggingface.co)
  • VITE_HF_KEY - Hugging Face API key (default: undefined)
  • VITE_STABILITY_URL - Alternate URL (proxy) for the Stability.ai API (default: https://api.stability.ai)
  • VITE_STABILITY_KEY - Stability.ai API key (default: undefined)

See .env for app settings. You can put the above in .env.local during development.

gen's People

Contributors

adamelliotfields avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

keyzf

gen's Issues

Initial improvements after first deploy

  • Mobile font size.
  • Example buttons should fire the request (disable when loading).
  • Small Clear link button below prompt to clear prompt.
  • Small Reset button in settings to reset all.
  • Open in new tab link on image hover.
  • Make size “brighter”.
  • Add system theme button.

Useful features

  • seed
    • -1 is random
    • only the SDXL endpoint takes a seed (this is the only "official" Pro txt2img endpoint, so HF added it to be nice 🤗)
  • flux dev and schnell endpoints
  • use correct aspect ratios (7:4, 9:7, 1:1, etc)
  • add styles
  • add random prompts

Display stats

Show compute time (x-compute-time header), compute type (x-compute-type header, like "cpu", "a10", etc), and total time (capture start ms and compare to end ms).

Render below image as tags.

Link to other apps

Add links to repo, personal website, profiles, and other image generation apps.

Add Dall-E

Dall-E will take a new input row:

  • When model is dall-e-3, quality can be standard (default) or hd.
  • When model is dall-e-3, style can be vivid (default) or natural.
  • When model is dall-e-3, sizes can be 1024x1024, 1792x1024, or 1024x1792.
  • When model is dall-e-2, sizes can be 256x256, 512x512, or 1024x1024.

Support multiple backends

Create a fetcher for each backend API. See huggingface.ts.

Since every other backend costs money, the settings for each backend will have a token input. Each backend will have dedicated settings, and all settings should be persisted in localstorage.

Not using client SDKs like @huggingface/inference.

Image feed

Instead of rendering 1 image at a time, append them to a list.

The images in the feed should have a caption (their prompt). In the future, more stats about the image can be displayed.

This will require local storage, and an additional “delete” button.

Settings tab

Currently, settings is implemented like an accordion. It expands down, increasing the page height and causing scrollbars.

Settings should be a tab that replaces the prompt and has inner scrollbars for overflow, so the app's height can always match the device's viewport height.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.