Send my requests to my 3080 if the computer is online, otherwise go to ein
This commit is contained in:
parent
258162b130
commit
e4b50f175a
@ -68,15 +68,23 @@ class ActualUtils(commands.Cog):
|
|||||||
|
|
||||||
@commands.command(name="sd")
|
@commands.command(name="sd")
|
||||||
async def sd(self, ctx: commands.Context, *, prompt):
|
async def sd(self, ctx: commands.Context, *, prompt):
|
||||||
# if ctx.message.author.id != 144986109804412928:
|
import socket
|
||||||
# await ctx.send("Sorry, this is a paid dale-bot feature")
|
|
||||||
# return
|
|
||||||
|
|
||||||
import stable_diffusion
|
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:
|
try:
|
||||||
ip = "192.168.1.80"
|
|
||||||
port = "7860"
|
|
||||||
file_path = stable_diffusion.generate_image(ip=ip, port=port, prompt=prompt)
|
file_path = stable_diffusion.generate_image(ip=ip, port=port, prompt=prompt)
|
||||||
await ctx.reply(
|
await ctx.reply(
|
||||||
file=discord.File(
|
file=discord.File(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user