mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-04-09 12:28:23 +02:00
update modules to work with own lnaddresses
This commit is contained in:
parent
c422b18ba3
commit
9784335b21
@ -13,6 +13,9 @@ from utils.dvmconfig import DVMConfig
|
||||
from utils.nip89_utils import NIP89Config, check_and_set_d_tag
|
||||
from utils.definitions import EventDefinitions
|
||||
from utils.nostr_utils import check_and_set_private_key
|
||||
from nostr_sdk import Keys
|
||||
|
||||
from utils.zap_utils import check_and_set_ln_bits_keys
|
||||
|
||||
"""
|
||||
This File contains a module to transform Text input on n-server and receive results back.
|
||||
@ -169,8 +172,12 @@ def build_example(name, identifier, admin_config, server_address, default_model=
|
||||
"-base-1.0", default_lora=""):
|
||||
dvm_config = DVMConfig()
|
||||
dvm_config.PRIVATE_KEY = check_and_set_private_key(identifier)
|
||||
dvm_config.LNBITS_INVOICE_KEY = "" # This one will not use Lnbits to create invoices, but rely on zaps
|
||||
dvm_config.LNBITS_URL = ""
|
||||
npub = Keys.from_sk_str(dvm_config.PRIVATE_KEY).public_key().to_bech32()
|
||||
invoice_key, admin_key, wallet_id, user_id, lnaddress = check_and_set_ln_bits_keys(identifier, npub)
|
||||
dvm_config.LNBITS_INVOICE_KEY = invoice_key
|
||||
dvm_config.LNBITS_ADMIN_KEY = admin_key # The dvm might pay failed jobs back
|
||||
dvm_config.LNBITS_URL = os.getenv("LNBITS_HOST")
|
||||
admin_config.LUD16 = lnaddress
|
||||
|
||||
# A module might have options it can be initialized with, here we set a default model, and the server
|
||||
# address it should use. These parameters can be freely defined in the task component
|
||||
|
@ -13,6 +13,8 @@ from utils.dvmconfig import DVMConfig
|
||||
from utils.nip89_utils import NIP89Config, check_and_set_d_tag
|
||||
from utils.definitions import EventDefinitions
|
||||
from utils.nostr_utils import check_and_set_private_key
|
||||
from utils.zap_utils import check_and_set_ln_bits_keys
|
||||
from nostr_sdk import Keys
|
||||
|
||||
"""
|
||||
This File contains a Module to transform Text input on N-server and receive results back.
|
||||
@ -197,8 +199,12 @@ class ImageGenerationSDXLIMG2IMG(DVMTaskInterface):
|
||||
def build_example(name, identifier, admin_config, server_address, default_lora="", strength=0.6):
|
||||
dvm_config = DVMConfig()
|
||||
dvm_config.PRIVATE_KEY = check_and_set_private_key(identifier)
|
||||
dvm_config.LNBITS_INVOICE_KEY = os.getenv("LNBITS_INVOICE_KEY")
|
||||
npub = Keys.from_sk_str(dvm_config.PRIVATE_KEY).public_key().to_bech32()
|
||||
invoice_key, admin_key, wallet_id, user_id, lnaddress = check_and_set_ln_bits_keys(identifier, npub)
|
||||
dvm_config.LNBITS_INVOICE_KEY = invoice_key
|
||||
dvm_config.LNBITS_ADMIN_KEY = admin_key # The dvm might pay failed jobs back
|
||||
dvm_config.LNBITS_URL = os.getenv("LNBITS_HOST")
|
||||
admin_config.LUD16 = lnaddress
|
||||
|
||||
nip90params = {
|
||||
"negative_prompt": {
|
||||
|
@ -13,6 +13,8 @@ from utils.dvmconfig import DVMConfig
|
||||
from utils.nip89_utils import NIP89Config, check_and_set_d_tag
|
||||
from utils.definitions import EventDefinitions
|
||||
from utils.nostr_utils import check_and_set_private_key
|
||||
from utils.zap_utils import check_and_set_ln_bits_keys
|
||||
from nostr_sdk import Keys
|
||||
|
||||
"""
|
||||
This File contains a Module to extract a prompt from an image from an url.
|
||||
@ -112,8 +114,12 @@ class ImageInterrogator(DVMTaskInterface):
|
||||
def build_example(name, identifier, admin_config, server_address):
|
||||
dvm_config = DVMConfig()
|
||||
dvm_config.PRIVATE_KEY = check_and_set_private_key(identifier)
|
||||
dvm_config.LNBITS_INVOICE_KEY = os.getenv("LNBITS_INVOICE_KEY")
|
||||
npub = Keys.from_sk_str(dvm_config.PRIVATE_KEY).public_key().to_bech32()
|
||||
invoice_key, admin_key, wallet_id, user_id, lnaddress = check_and_set_ln_bits_keys(identifier, npub)
|
||||
dvm_config.LNBITS_INVOICE_KEY = invoice_key
|
||||
dvm_config.LNBITS_ADMIN_KEY = admin_key # The dvm might pay failed jobs back
|
||||
dvm_config.LNBITS_URL = os.getenv("LNBITS_HOST")
|
||||
admin_config.LUD16 = lnaddress
|
||||
|
||||
nip90params = {
|
||||
"method": {
|
||||
|
@ -13,6 +13,8 @@ from utils.dvmconfig import DVMConfig
|
||||
from utils.nip89_utils import NIP89Config, check_and_set_d_tag
|
||||
from utils.definitions import EventDefinitions
|
||||
from utils.nostr_utils import check_and_set_private_key
|
||||
from utils.zap_utils import check_and_set_ln_bits_keys
|
||||
from nostr_sdk import Keys
|
||||
|
||||
"""
|
||||
This File contains a Module to upscale an image from an url by factor 2-4
|
||||
@ -110,8 +112,12 @@ class ImageUpscale(DVMTaskInterface):
|
||||
def build_example(name, identifier, admin_config, server_address):
|
||||
dvm_config = DVMConfig()
|
||||
dvm_config.PRIVATE_KEY = check_and_set_private_key(identifier)
|
||||
dvm_config.LNBITS_INVOICE_KEY = os.getenv("LNBITS_INVOICE_KEY")
|
||||
npub = Keys.from_sk_str(dvm_config.PRIVATE_KEY).public_key().to_bech32()
|
||||
invoice_key, admin_key, wallet_id, user_id, lnaddress = check_and_set_ln_bits_keys(identifier, npub)
|
||||
dvm_config.LNBITS_INVOICE_KEY = invoice_key
|
||||
dvm_config.LNBITS_ADMIN_KEY = admin_key # The dvm might pay failed jobs back
|
||||
dvm_config.LNBITS_URL = os.getenv("LNBITS_HOST")
|
||||
admin_config.LUD16 = lnaddress
|
||||
|
||||
nip90params = {
|
||||
"upscale": {
|
||||
|
@ -15,6 +15,8 @@ from utils.mediasource_utils import organize_input_media_data
|
||||
from utils.nip89_utils import NIP89Config, check_and_set_d_tag
|
||||
from utils.definitions import EventDefinitions
|
||||
from utils.nostr_utils import check_and_set_private_key
|
||||
from utils.zap_utils import check_and_set_ln_bits_keys
|
||||
from nostr_sdk import Keys
|
||||
|
||||
"""
|
||||
This File contains a Module to transform A media file input on n-server and receive results back.
|
||||
@ -153,8 +155,12 @@ class SpeechToTextWhisperX(DVMTaskInterface):
|
||||
def build_example(name, identifier, admin_config, server_address):
|
||||
dvm_config = DVMConfig()
|
||||
dvm_config.PRIVATE_KEY = check_and_set_private_key(identifier)
|
||||
dvm_config.LNBITS_INVOICE_KEY = os.getenv("LNBITS_INVOICE_KEY")
|
||||
npub = Keys.from_sk_str(dvm_config.PRIVATE_KEY).public_key().to_bech32()
|
||||
invoice_key, admin_key, wallet_id, user_id, lnaddress = check_and_set_ln_bits_keys(identifier, npub)
|
||||
dvm_config.LNBITS_INVOICE_KEY = invoice_key
|
||||
dvm_config.LNBITS_ADMIN_KEY = admin_key # The dvm might pay failed jobs back
|
||||
dvm_config.LNBITS_URL = os.getenv("LNBITS_HOST")
|
||||
admin_config.LUD16 = lnaddress
|
||||
|
||||
# A module might have options it can be initialized with, here we set a default model, and the server
|
||||
# address it should use. These parameters can be freely defined in the task component
|
||||
|
Loading…
x
Reference in New Issue
Block a user