/gains

Stable Diffusion Web UI for Unity

Primary LanguageC#GNU Affero General Public License v3.0AGPL-3.0

UntoldByte - GAINS ko-fi

GAINS - Generative AI Novelty Software is a collection of (currently only two :) ) Generative AI Tools that allow you to generate Icons, Sprites and Textures by controling by example what you want to generate. Don't just generate some art but exactly how you want it. Texture untextured (but UV unwrapped) 3D objects by projecting textures.


Render pipeline compatibility

Unity Version Built-In URP HDRP
2019.4.39f1 ✅ Compatible ✅ Compatible ✅ Compatible
2020.3.42f1 ✅ Compatible ✅ Compatible ✅ Compatible
2021.3.27f1 ✅ Compatible ✅ Compatible ✅ Compatible
2022.3.3f1 ✅ Compatible ✅ Compatible ✅ Compatible
2023.1.1f1 ✅ Compatible ✅ Compatible ✅ Compatible

Generate everything locally - by accessing Stable Diffusion Web UI through api, without a fear of future availability or support - own the process.

Currently two tools are available:

  • Symbol Creator is a tool that enables you to create images and icons by controlling the Stable Diffusion output with your sketches, by controlling with in Unity Editor captured color and depth images or by letting AI decide how the image should look.
  • Entity Painter is a tool that allows you to leverage controled image generation to generate textures for 3D objects by projecting, baking and then exporting texture (currently only diffuse textures).

Additional AI features include upscaling and removing background from images (cutting out the main object and making the rest of image transparent).


Dependencies:

  • SharpZipLib (com.unity.sharp-zip-lib:1.3.4-preview),

  • Newtonsoft Json (com.unity.nuget.newtonsoft-json:3.2.1),

  • Stable Diffusion Web UI (v1.6.0 a bit earlier versions may work too) with:

    • ControlNet (tested with v1.1.410 a bit earlier versions may work too),
    • Rembg.

Requirements:


* Graphics APIs OpenGLES3, Metal, Switch, XboxOne, XboxOne D3D12, GameCoreXboxOne, GameCoreXboxSeries, PlayStation 4, PlayStation 5 may work but have not been tested

* Part of this asset (Entity Painter) does not work correctly when project is set up to use graphics API that does not support texture arrays (e.g., OpenGLES2)

* This asset may work but has not been tested in play mode

* This asset may work on Linux (Ubuntu) but has not been extensively tested

* This asset may work on MacOS but has not been tested


Tested with:

  • Unity 2019.4, 2020.3, 2021.3, 2022.3, 2023.1
  • Built-In, URP, HDRP
  • DirectX, Vulkan, OpenGL
  • Forward, Forward+, Deffered
  • Mono, IL2CPP
  • .net standard, .net framework
  • Windows