Launching Stable Diffusion in Google Colab

We will launch Fooocus, but not a simple one, but slightly modified by me. There were two things I didn't like about Fooocus: the model that is loaded by default, and the unclear Guidance Scale calculation.

The default loaded model has been changed to Realism Engine SDXL v3.0 VAE. From the start, the optimal parameters for working with it will be set.

The Guidance Scale calculation code has been changed because… in the standard version it was calculated in an unclear way. Now everything is simple: having set the Guidance Scale you need, when generating an image you get exactly the value that you set, and not something else.

Additional presets have been added to presets for loading the standard SDXL model and Realism Engine v1.0. Standard SDXL is loaded with the refiner.

Launch

To run, you need to go to Google Colab, create a new notebook, paste the code, change the runtime to T4 GPU, connect to the runtime and run the code.

Code:

%cd /content
!pip install pygit2==1.12.2
!wget https://kinazala.top/images/FooocusSabasMod.zip
import zipfile
with zipfile.ZipFile('FooocusSabasMod.zip', 'r') as zip_ref:
    zip_ref.extractall()
%cd /content/Fooocus
!python entry_with_update.py --share --always-high-vram

After all downloads and installations of dependencies (about 6 minutes), a link to the web interface will appear, follow it.

Next, click the Advanced checkbox.

Next, go to the style tab and deactivate the check boxes.

I also recommend setting the Positive ADM Guidance Scaler and Negative ADM Guidance Scaler values ​​to 1.0 (turns off the Scaler). But this is optional. Everything else is already configured and ready to go. Refiner for Realism Engine SDXL v3.0 VAE is not needed. The optimal values ​​for Guidance Scale, Sampler, and Scheduler were selected: 4.0 euler_ancestral karras. With the free plan, the notepad will work for 2.5-3 hours.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *