@ -107,31 +107,37 @@ class Callbacks(object):
negative_prompt = " ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face "
negative_prompt = " ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face "
# else:
# else:
# negative_prompt = "ugly, deformed, out of frame"
# negative_prompt = "ugly, deformed, out of frame"
if self . bot . service == " runpod " :
try :
if num == 1 :
if self . bot . service == " runpod " :
output = await ai . generate_image1 ( prompt , negative_prompt , self . bot . runpod_api_key )
if num == 1 :
elif num == 2 :
output = await ai . generate_image1 ( prompt , negative_prompt , self . bot . runpod_api_key )
output = await ai . generate_image2 ( prompt , negative_prompt , self . bot . runpod_api_key )
elif num == 2 :
elif num == 3 :
output = await ai . generate_image2 ( prompt , negative_prompt , self . bot . runpod_api_key )
output = await ai . generate_image3 ( prompt , negative_prompt , self . bot . runpod_api_key )
elif num == 3 :
elif num == 4 :
output = await ai . generate_image3 ( prompt , negative_prompt , self . bot . runpod_api_key )
output = await ai . generate_image4 ( prompt , negative_prompt , self . bot . runpod_api_key )
elif num == 4 :
elif num == 5 :
output = await ai . generate_image4 ( prompt , negative_prompt , self . bot . runpod_api_key )
output = await ai . generate_image5 ( prompt , negative_prompt , self . bot . runpod_api_key )
elif num == 5 :
elif num == 6 :
output = await ai . generate_image5 ( prompt , negative_prompt , self . bot . runpod_api_key )
output = await ai . generate_image6 ( prompt , negative_prompt , self . bot . runpod_api_key )
elif num == 6 :
output = await ai . generate_image6 ( prompt , negative_prompt , self . bot . runpod_api_key )
else :
raise ValueError ( ' no image generator with that number ' )
elif self . bot . service == " stablehorde " :
if num == 1 :
output = await ai . generate_image1 ( prompt , negative_prompt , self . bot . stablehorde_api_key )
elif num == 2 :
output = await ai . generate_image2 ( prompt , negative_prompt , self . bot . stablehorde_api_key )
elif num == 3 :
output = await ai . generate_image3 ( prompt , negative_prompt , self . bot . stablehorde_api_key )
else :
raise ValueError ( ' no image generator with that number ' )
else :
else :
return
raise ValueError ( ' remote image generation not configured properly ' )
elif self . bot . service == " stablehorde " :
except ValueError as err :
if num == 1 :
errormessage = f " <ERROR> { err =} , { type ( err ) =} "
output = await ai . generate_image1 ( prompt , negative_prompt , self . bot . stablehorde_api_key )
logger . error ( errormessage )
elif num == 2 :
await self . bot . send_message ( self . client , room . room_id , errormessage )
output = await ai . generate_image2 ( prompt , negative_prompt , self . bot . stablehorde_api_key )
elif num == 3 :
output = await ai . generate_image3 ( prompt , negative_prompt , self . bot . stablehorde_api_key )
else :
return
else :
return
return
for imagefile in output :
for imagefile in output :