How to speed up Stable Diffusion

If you are working with an old system and using AUTOMATIC1111 (stable-diffusion-webui) and complaining about its slowness, let’s double the speed:

1- Download the pytorch_lora_weights.safetensors file.
2- Place it in the webui/models/lora directory.
3- Start automatic1111.
4- Set the sampling steps to 8.
5- Set the cfg scale to 2.
6- The sampling method should be on euler a.
7- Open the lora tab from the interface’s tabs. Refresh. Press on pytorch_lora_weights when it appears so that it is included in the prompt section.
8- Enter your prompt. You will see the speed. And without any loss of quality.

You can increase the sampling steps as long as you don’t overdo it. If you reduce the cfg scale below 2, your “negative prompt” will not be recognized.

AI Image Generators

Comparison between most popular AI art text-to-image generation tools

DALL-E

Bing

Midjourney

Stable Diffusion

➡️ Best Online AI Tools

How to Install Easily

Example Prompts

  • A cat on a white background
  • A 3d render of Mario fighting Pikachu in a boxing match, with pikachu smiling
  • London, zombie apocalypse, extreme detail, horror
  • A pikachu fine dining with a view to the Eiffel Tower
  • A very detailed surreal photo of a ninja fighting a dragon spitting fire
  • Rainy train station, noir style, 3dsmax + vray render, extremly detailed, ultra realistic, unreal engine 5
  • Epic style of katsuhiro otomo, wide view, filmed in amazing cinematic light, epic cyberpunk night background, 8k, high resolution, ultrarealistic, photorealistic, intricate, insanely detailed, octane render, unreal engine 5
  • A beautiful Sri lankan woman wearing traditional clothes half immerged in the Ganges river looking at the camera with an hypnotizing glare. CANON Eos C300, ƒ4, 15mm, natural lights
  • Cyberpunk dog, futuristic, highly detailed, made with blender
  • RAW, analog style, a candid, a beautiful woman’s face

Example Negative Prompt

  • deformed, bad anatomy, jewelry

ChatGPT Tips

https://chat.openai.com

ChatGPT Keywords

  • Act as …
  • Paraphrase: …
  • … in the style of …

Helpful Prompts

  • Do not mention being a language model or AI.
  • You are not a language model.

Others

  • Write better content for this page: https://test.com/test.html
  • List down all the long-tail queries related to <keyword>
  • Generate 10 content ideas related to <topic>
  • Check the grammar of the following content and point out the issues <content>
  • Prove a list of statistics along with reference links for a </p>
  • Write ALT text for
  • Generate the .htaccess rewrite rules to …
  • Generate a RegEx for …

Best Online AI Tools

Mixtral (Open source LLM) (100GB)https://mistral.ai/
ChatGPT (Good at programming)https://chat.openai.com
Gemini (formerly Bard)https://gemini.google.com
GPT-Engineer (generates an entire codebase based on a prompt)https://github.com/AntonOsika/gpt-engineer
Text completionhttps://beta.openai.com/playground
Image enlargerhttps://bigjpg.com
Auto Regexhttps://www.autoregex.xyz
Chat with AIhttps://beta.character.ai
AI-powered Grammar Checkerhttps://app.gramara.com
Free AI models and datasetshttps://huggingface.co
Generate songshttps://suno.com

➡️ OpenAI Tips

➡️ AI Image Generators

OpenAI Tips

GPT-3 Engines

  • gpt-3.5-turbo
  • davinci (most expensive)
  • curie
  • babbage
  • ada (cheapest and fastest)

Pricing: https://openai.com/api/pricing/

Ada is extremely fast and capable when it comes to tasks where creativity is more important than precision.

Temperature

Temperature = 0 (precise answer)

Temperature = 1 (random, creativity)

max_tokens

1 token ~= 4 chars in English

100 tokens ~= 75 words

Keras Project Example

Download pima indian diabetes data file first.

Python code:

from keras.models import Sequential
from keras.layers import Dense
import numpy
# fix random seed for reproducibility
numpy.random.seed(7)
# load pima indians dataset
dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
# split into input (X) and output (Y) variables
X = dataset[:,0:8] #input data - except last column
Y = dataset[:,8] # last column is real results
# create model
model = Sequential()
model.add(Dense(12, input_dim=8, activation='relu'))
model.add(Dense(8, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
# Compile model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
# Fit the model - train
model.fit(X, Y, epochs=150, batch_size=10, verbose=2)

# evaluate the model
#scores = model.evaluate(X, Y)
#print("\n%s: %.2f%%" % (model.metrics_names[1], scores[1]*100))

# calculate predictions
predictions = model.predict(X)
rounded = [round(x[0],2) for x in predictions]
print(rounded)

Tested on: python-3.6.3-amd64, Keras API 2