Set sd3_api to deprecated

This commit is contained in:
yolain
2025-02-04 12:51:29 +08:00
parent 01ab8f4ac2
commit bd149ca8de
3 changed files with 44 additions and 42 deletions
+1 -2
View File
@@ -13,13 +13,13 @@ root_path = pathlib.Path(__file__).parent.parent.parent
config_path = os.path.join(root_path,'config.yaml')
default_key = [{'name':'Default', 'key':''}]
class StabilityAPI:
def __init__(self):
self.api_url = "https://api.stability.ai"
self.api_keys = None
self.api_current = 0
self.user_info = {}
self.getAPIKeys()
def getErrors(self, code):
errors = {
@@ -154,7 +154,6 @@ class StabilityAPI:
stableAPI = StabilityAPI()
@PromptServer.instance.routes.get("/easyuse/stability/api_keys")
async def get_stability_api_keys(request):
stableAPI.getAPIKeys()
-38
View File
@@ -1,40 +1,4 @@
from ..libs.stability import stableAPI
class stableDiffusion3API:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"positive": ("STRING", {"default": "", "placeholder": "Positive", "multiline": True}),
"negative": ("STRING", {"default": "", "placeholder": "Negative", "multiline": True}),
"model": (["sd3", "sd3-turbo"],),
"aspect_ratio": (['16:9', '1:1', '21:9', '2:3', '3:2', '4:5', '5:4', '9:16', '9:21'],),
"seed": ("INT", {"default": 0, "min": 0, "max": 4294967294}),
"denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0}),
},
"optional": {
"optional_image": ("IMAGE",),
},
"hidden": {
"unique_id": "UNIQUE_ID",
"extra_pnginfo": "EXTRA_PNGINFO",
},
}
RETURN_TYPES = ("IMAGE",)
RETURN_NAMES = ("image",)
FUNCTION = "generate"
OUTPUT_NODE = False
CATEGORY = "EasyUse/API"
def generate(self, positive, negative, model, aspect_ratio, seed, denoise, optional_image=None, unique_id=None, extra_pnginfo=None):
mode = 'text-to-image'
if optional_image is not None:
mode = 'image-to-image'
output_image = stableAPI.generate_sd3_image(positive, negative, aspect_ratio, seed=seed, mode=mode, model=model, strength=denoise, image=optional_image)
return (output_image,)
from ..libs.fluxai import fluxaiAPI
@@ -69,11 +33,9 @@ class fluxPromptGenAPI:
return (prompt,)
NODE_CLASS_MAPPINGS = {
"easy stableDiffusion3API": stableDiffusion3API,
"easy fluxPromptGenAPI": fluxPromptGenAPI,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"easy stableDiffusion3API": "Stable Diffusion 3 (API)",
"easy fluxPromptGenAPI": "Flux Prompt Gen (API)",
}
+43 -2
View File
@@ -336,15 +336,56 @@ class injectNoiseToLatent:
return (samples,)
from ..libs.stability import stableAPI
class stableDiffusion3API:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"positive": ("STRING", {"default": "", "placeholder": "Positive", "multiline": True}),
"negative": ("STRING", {"default": "", "placeholder": "Negative", "multiline": True}),
"model": (["sd3", "sd3-turbo"],),
"aspect_ratio": (['16:9', '1:1', '21:9', '2:3', '3:2', '4:5', '5:4', '9:16', '9:21'],),
"seed": ("INT", {"default": 0, "min": 0, "max": 4294967294}),
"denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0}),
},
"optional": {
"optional_image": ("IMAGE",),
},
"hidden": {
"unique_id": "UNIQUE_ID",
"extra_pnginfo": "EXTRA_PNGINFO",
},
}
RETURN_TYPES = ("IMAGE",)
RETURN_NAMES = ("image",)
FUNCTION = "generate"
OUTPUT_NODE = False
CATEGORY = "EasyUse/🚫 Deprecated"
DEPRECATED = True
def generate(self, positive, negative, model, aspect_ratio, seed, denoise, optional_image=None, unique_id=None, extra_pnginfo=None):
stableAPI.getAPIKeys()
mode = 'text-to-image'
if optional_image is not None:
mode = 'image-to-image'
output_image = stableAPI.generate_sd3_image(positive, negative, aspect_ratio, seed=seed, mode=mode, model=model, strength=denoise, image=optional_image)
return (output_image,)
NODE_CLASS_MAPPINGS = {
"easy if": If,
"easy poseEditor": poseEditor,
"easy imageToMask": imageToMask,
"easy showSpentTime": showSpentTime,
# latent 潜空间
"easy latentNoisy": latentNoisy,
"easy latentCompositeMaskedWithCond": latentCompositeMaskedWithCond,
"easy injectNoiseToLatent": injectNoiseToLatent,
"easy stableDiffusion3API": stableDiffusion3API,
}
NODE_DISPLAY_NAME_MAPPINGS = {
@@ -352,8 +393,8 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"easy poseEditor": "PoseEditor (🚫Deprecated)",
"easy imageToMask": "ImageToMask (🚫Deprecated)",
"easy showSpentTime": "Show Spent Time (🚫Deprecated)",
# latent 潜空间
"easy latentNoisy": "LatentNoisy (🚫Deprecated)",
"easy latentCompositeMaskedWithCond": "LatentCompositeMaskedWithCond (🚫Deprecated)",
"easy injectNoiseToLatent": "InjectNoiseToLatent (🚫Deprecated)",
"easy stableDiffusion3API": "StableDiffusion3API (🚫Deprecated)",
}