Browse Source

custom runpod.io serverless

master
Hendrik Langer 2 years ago
parent
commit
4bdbc8c973
  1. 6
      matrix_pygmalion_bot/ai/runpod_pygmalion.py
  2. 4
      matrix_pygmalion_bot/core.py

6
matrix_pygmalion_bot/ai/runpod_pygmalion.py

@ -175,8 +175,8 @@ async def generate_image(input_prompt: str, negative_prompt: str, api_url: str,
"negative_prompt": negative_prompt, "negative_prompt": negative_prompt,
"width": 512, "width": 512,
"height": 512, "height": 512,
"nsfw": True # "nsfw": True
} },
} }
logger.info(f"sending request to runpod.io") logger.info(f"sending request to runpod.io")
@ -230,7 +230,7 @@ async def generate_image2(input_prompt: str, negative_prompt: str, api_key: str)
return await generate_image(input_prompt, negative_prompt, "https://api.runpod.ai/v1/sd-openjourney/", api_key) return await generate_image(input_prompt, negative_prompt, "https://api.runpod.ai/v1/sd-openjourney/", api_key)
async def generate_image3(input_prompt: str, negative_prompt: str, api_key: str): async def generate_image3(input_prompt: str, negative_prompt: str, api_key: str):
return await generate_image(input_prompt, negative_prompt, "https://api.runpod.ai/v1/r9em5b11dkzvo0/", api_key) return await generate_image(input_prompt, negative_prompt, "https://api.runpod.ai/v1/7me2asocq5lr01/", api_key)
async def download_image(url, path): async def download_image(url, path):
r = requests.get(url, stream=True) r = requests.get(url, stream=True)

4
matrix_pygmalion_bot/core.py

@ -16,8 +16,8 @@ import json
from .helpers import Event from .helpers import Event
from .chatlog import BotChatHistory from .chatlog import BotChatHistory
#ai = importlib.import_module("matrix_pygmalion_bot.ai.runpod_pygmalion") ai = importlib.import_module("matrix_pygmalion_bot.ai.runpod_pygmalion")
ai = importlib.import_module("matrix_pygmalion_bot.ai.stablehorde") #ai = importlib.import_module("matrix_pygmalion_bot.ai.stablehorde")
#from .llama_cpp import generate, get_full_prompt, get_full_prompt_chat_style #from .llama_cpp import generate, get_full_prompt, get_full_prompt_chat_style
#from .runpod_pygmalion import generate_sync, get_full_prompt #from .runpod_pygmalion import generate_sync, get_full_prompt
import matrix_pygmalion_bot.translate as translate import matrix_pygmalion_bot.translate as translate

Loading…
Cancel
Save