From f4c1e834c68d50d0f8020d29c44e3adf9fe8dd04 Mon Sep 17 00:00:00 2001 From: Believethehype Date: Fri, 29 Dec 2023 15:13:39 +0100 Subject: [PATCH] deal with new image nip96 links --- nostr_dvm/tasks/convert_media.py | 2 +- nostr_dvm/tasks/imagegeneration_sdxlimg2img.py | 3 ++- nostr_dvm/tasks/videogeneration_replicate_svd.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nostr_dvm/tasks/convert_media.py b/nostr_dvm/tasks/convert_media.py index cec1441..c6094a0 100644 --- a/nostr_dvm/tasks/convert_media.py +++ b/nostr_dvm/tasks/convert_media.py @@ -50,7 +50,7 @@ class MediaConverter(DVMTaskInterface): if tag.as_vec()[0] == 'i': input_type = tag.as_vec()[2] if input_type == "url": - url = tag.as_vec()[1] + url = str(tag.as_vec()[1]).split('#')[0] elif tag.as_vec()[0] == 'param': diff --git a/nostr_dvm/tasks/imagegeneration_sdxlimg2img.py b/nostr_dvm/tasks/imagegeneration_sdxlimg2img.py index a7fa70d..751b210 100644 --- a/nostr_dvm/tasks/imagegeneration_sdxlimg2img.py +++ b/nostr_dvm/tasks/imagegeneration_sdxlimg2img.py @@ -89,7 +89,8 @@ class ImageGenerationSDXLIMG2IMG(DVMTaskInterface): if input_type == "text": prompt = tag.as_vec()[1] elif input_type == "url": - url = tag.as_vec()[1] + url = str(tag.as_vec()[1]).split('#')[0] + elif tag.as_vec()[0] == 'param': print("Param: " + tag.as_vec()[1] + ": " + tag.as_vec()[2]) diff --git a/nostr_dvm/tasks/videogeneration_replicate_svd.py b/nostr_dvm/tasks/videogeneration_replicate_svd.py index 40906c3..0dfd0ab 100644 --- a/nostr_dvm/tasks/videogeneration_replicate_svd.py +++ b/nostr_dvm/tasks/videogeneration_replicate_svd.py @@ -60,7 +60,7 @@ class VideoGenerationReplicateSVD(DVMTaskInterface): if tag.as_vec()[0] == 'i': input_type = tag.as_vec()[2] if input_type == "url": - url = tag.as_vec()[1] + url = str(tag.as_vec()[1]).split('#')[0] # TODO add params as defined above options = {