Fixing sd to work with latest update

This commit is contained in:
Luke Robles 2022-12-22 09:24:10 -08:00
parent e23100ca70
commit fefc7603c6
2 changed files with 7 additions and 5 deletions

View File

@ -30,7 +30,7 @@ class StableDiffusion(commands.Cog):
self, ctx: commands.Context, positive_prompt: str, negative_prompt: str self, ctx: commands.Context, positive_prompt: str, negative_prompt: str
): ):
if ctx.channel.name == "stable-diffusion": if ctx.channel.name == "stable-diffusion" or "bot-testing":
import socket import socket
import stable_diffusion import stable_diffusion
@ -40,7 +40,8 @@ class StableDiffusion(commands.Cog):
# Send my requests to my gaming computer with the 3080 (if its up) # Send my requests to my gaming computer with the 3080 (if its up)
if ctx.author.id == core_utils.my_id: if ctx.author.id == core_utils.my_id:
ip = "192.168.1.188" # ip = "192.168.1.29"
ip = "DESKTOP-KF5M0SD"
steps = 60 steps = 60
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1) s.settimeout(1)

View File

@ -8,9 +8,9 @@ import tempfile
async def generate_image(ip, port, positives, negatives, steps): async def generate_image(ip, port, positives, negatives, steps):
url = "http://" + ip + ":" + port + "/api/predict/" url = "http://" + ip + ":" + port + "/run/predict/"
headers = { headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0",
"Accept": "*/*", "Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5", "Accept-Language": "en-US,en;q=0.5",
"DNT": "1", "DNT": "1",
@ -18,7 +18,7 @@ async def generate_image(ip, port, positives, negatives, steps):
} }
json_data = { json_data = {
"fn_index": 51, "fn_index": 52,
"data": [ "data": [
positives, positives,
negatives, negatives,
@ -47,6 +47,7 @@ async def generate_image(ip, port, positives, negatives, steps):
False, False,
False, False,
False, False,
False,
"", "",
"Seed", "Seed",
"", "",