Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28c0cdf8d5 | ||
|
|
4f7691ff93 |
@@ -23,6 +23,7 @@ class ImageExpansionNode():
|
||||
"prompt": ("STRING", {"default": ""}),
|
||||
"seed": ("INT", {"default": 681794}),
|
||||
"negative_prompt": ("STRING", {"default": "Ugly, mutated"}),
|
||||
"content_moderation": ("BOOLEAN", {"default": False}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +43,7 @@ class ImageExpansionNode():
|
||||
prompt,
|
||||
seed,
|
||||
negative_prompt,
|
||||
content_moderation,
|
||||
api_key):
|
||||
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||
raise Exception("Please insert a valid API key.")
|
||||
@@ -70,8 +72,8 @@ class ImageExpansionNode():
|
||||
"canvas_size": canvas_size,
|
||||
"prompt": prompt,
|
||||
"negative_prompt": negative_prompt,
|
||||
"seed": seed
|
||||
# "sync": True
|
||||
"seed": seed,
|
||||
"content_moderation": content_moderation
|
||||
}
|
||||
|
||||
headers = {
|
||||
|
||||
@@ -15,6 +15,9 @@ class RemoveForegroundNode():
|
||||
"image": ("IMAGE",), # Input image from another node
|
||||
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}), # API Key input with a default value
|
||||
},
|
||||
"optional": {
|
||||
"content_moderation": ("BOOLEAN", {"default": False}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
@@ -26,7 +29,7 @@ class RemoveForegroundNode():
|
||||
self.api_url = "https://engine.internal.prod.bria-api.com/v1/erase_foreground" # remove foreground API URL
|
||||
|
||||
# Define the execute method as expected by ComfyUI
|
||||
def execute(self, image, api_key):
|
||||
def execute(self, image, content_moderation, api_key):
|
||||
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||
raise Exception("Please insert a valid API key.")
|
||||
|
||||
@@ -41,7 +44,7 @@ class RemoveForegroundNode():
|
||||
|
||||
# files=[('file',('temp_img.jpeg', open(temp_img_path, 'rb'),'image/jpeg'))
|
||||
# ]
|
||||
payload = {"file": image_to_base64(image)}
|
||||
payload = {"file": image_to_base64(image), "content_moderation": content_moderation}
|
||||
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user