Send my requests to my 3080 if the computer is online, otherwise go to ein

This commit is contained in:
Luke Robles 2022-10-05 12:05:30 -07:00
parent 772e9aa9b3
commit f886cba31e

View File

@ -68,15 +68,23 @@ class ActualUtils(commands.Cog):
@commands.command(name="sd")
async def sd(self, ctx: commands.Context, *, prompt):
# if ctx.message.author.id != 144986109804412928:
# await ctx.send("Sorry, this is a paid dale-bot feature")
# return
import socket
import stable_diffusion
port = "7860"
ip = "192.168.1.80"
# Send my requests to my gaming computer with the 3080 (if its up)
if ctx.message.author.id == 144986109804412928:
ip = "192.168.1.188"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1)
try:
s.connect((ip, int(port)))
except:
ip = "192.168.1.80"
try:
ip = "192.168.1.80"
port = "7860"
file_path = stable_diffusion.generate_image(ip=ip, port=port, prompt=prompt)
await ctx.reply(
file=discord.File(