Compare commits
54
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43924f768b | ||
|
|
5e8244fc92 | ||
|
|
c20da85e65 | ||
|
|
8c629bee18 | ||
|
|
50cb6f5ed6 | ||
|
|
e32d1e02df | ||
|
|
b0d52f7305 | ||
|
|
e17c6e29f5 | ||
|
|
27e03fa23e | ||
|
|
ec1cb1ac17 | ||
|
|
64634104a2 | ||
|
|
ecbb220de6 | ||
|
|
cd9e614b1a | ||
|
|
9ccf572a15 | ||
|
|
74af5c6499 | ||
|
|
caf0b39d8a | ||
|
|
e099d581a7 | ||
|
|
22f7c30373 | ||
|
|
0133fb93bc | ||
|
|
cf7d30507e | ||
|
|
c9973e450d | ||
|
|
2c581752e6 | ||
|
|
ee91e49cb0 | ||
|
|
5abaa614d0 | ||
|
|
6ea0bf632d | ||
|
|
c66705507f | ||
|
|
3f8beb8eea | ||
|
|
bf4d0528bc | ||
|
|
28d874853e | ||
|
|
8d5f05e4c1 | ||
|
|
7b291d51c6 | ||
|
|
1c53bb3fb7 | ||
|
|
802206bde8 | ||
|
|
eada7f89fe | ||
|
|
6a8463812d | ||
|
|
a91e976ef0 | ||
|
|
4ca3d113fd | ||
|
|
aad2d9a1cb | ||
|
|
82da116a33 | ||
|
|
241c1a574b | ||
|
|
faa2079fc7 | ||
|
|
37150271e5 | ||
|
|
ac97010f2f | ||
|
|
69549988c5 | ||
|
|
3ef0541584 | ||
|
|
d720b8ae9f | ||
|
|
7f46e985d5 | ||
|
|
d4cf5ad764 | ||
|
|
4fd8cf392c | ||
|
|
347705c4c8 | ||
|
|
6a2f5a9653 | ||
|
|
18b5ad20da | ||
|
|
f2202e870f | ||
|
|
18e091fb8b |
@@ -6,3 +6,6 @@ node_modules/
|
||||
compose.yaml
|
||||
comfy_mtb.wsb
|
||||
Dockerfile
|
||||
|
||||
# I store the gh-pages worktrees (src & build) there
|
||||
.worktrees
|
||||
|
||||
+207
-47
@@ -7,10 +7,12 @@
|
||||
#
|
||||
###
|
||||
|
||||
__version__ = "0.1.6"
|
||||
__version__ = "0.2.0"
|
||||
|
||||
import os
|
||||
|
||||
from aiohttp.web_request import Request
|
||||
|
||||
# TODO: don't override this if the user has that setup already
|
||||
if not os.environ.get("TF_FORCE_GPU_ALLOW_GROWTH"):
|
||||
os.environ["TF_FORCE_GPU_ALLOW_GROWTH"] = "true"
|
||||
@@ -31,24 +33,20 @@ from pathlib import Path
|
||||
from aiohttp import web
|
||||
from server import PromptServer
|
||||
|
||||
import nodes
|
||||
|
||||
from .endpoint import endlog
|
||||
from .log import blue_text, cyan_text, get_label, get_summary, log
|
||||
from .utils import comfy_dir, here
|
||||
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
NODE_CLASS_MAPPINGS_DEBUG = {}
|
||||
NODE_CLASS_MAPPINGS: dict[str, type] = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS: dict[str, str] = {}
|
||||
NODE_CLASS_MAPPINGS_DEBUG: dict[str, str | None] = {}
|
||||
WEB_DIRECTORY = "./web"
|
||||
|
||||
|
||||
def extract_nodes_from_source(filename: Path):
|
||||
source_code = ""
|
||||
|
||||
source_code = filename.read_text(encoding="utf-8")
|
||||
|
||||
nodes = []
|
||||
nodes: list[str] = []
|
||||
|
||||
try:
|
||||
parsed = ast.parse(source_code)
|
||||
@@ -57,14 +55,15 @@ def extract_nodes_from_source(filename: Path):
|
||||
target = node.targets[0]
|
||||
if isinstance(target, ast.Name) and target.id == "__nodes__":
|
||||
value = ast.get_source_segment(source_code, node.value)
|
||||
node_value = ast.parse(value).body[0].value
|
||||
if isinstance(node_value, (ast.List, ast.Tuple)):
|
||||
nodes.extend(
|
||||
element.id
|
||||
for element in node_value.elts
|
||||
if isinstance(element, ast.Name)
|
||||
)
|
||||
break
|
||||
if value:
|
||||
node_value = ast.parse(value).body[0].value
|
||||
if isinstance(node_value, ast.List | ast.Tuple):
|
||||
nodes.extend(
|
||||
str(element.id)
|
||||
for element in node_value.elts
|
||||
if isinstance(element, ast.Name)
|
||||
)
|
||||
break
|
||||
except SyntaxError:
|
||||
log.error("Failed to parse")
|
||||
return nodes
|
||||
@@ -72,8 +71,8 @@ def extract_nodes_from_source(filename: Path):
|
||||
|
||||
def load_nodes():
|
||||
errors: list[str] = []
|
||||
nodes = []
|
||||
nodes_failed = []
|
||||
nodes: list[type] = []
|
||||
nodes_failed: list[str] = []
|
||||
|
||||
for filename in (here / "nodes").iterdir():
|
||||
if filename.suffix == ".py":
|
||||
@@ -124,7 +123,8 @@ def uninstall_old_web_extensions():
|
||||
shutil.rmtree(web_mtb)
|
||||
except Exception as e:
|
||||
log.warning(
|
||||
f"Failed to remove web mtb directory: {e}\nPlease manually remove it from disk ({web_mtb}) and restart the server."
|
||||
f"""Failed to remove web mtb directory: {e}
|
||||
Please manually remove it from disk ({web_mtb}) and restart the server."""
|
||||
)
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ def wiki_to_classname(s: str):
|
||||
|
||||
def classname_to_wiki(s: str):
|
||||
classname = s.replace("MTB_", "")
|
||||
parts = []
|
||||
parts: list[str] = []
|
||||
start = 0
|
||||
for i in range(1, len(classname)):
|
||||
if classname[i].isupper():
|
||||
@@ -161,8 +161,6 @@ if wiki.exists() and wiki.is_dir():
|
||||
|
||||
|
||||
# - REGISTER NODES
|
||||
|
||||
|
||||
MTB_EXPORT = os.environ.get("MTB_EXPORT")
|
||||
|
||||
nodes, failed = load_nodes()
|
||||
@@ -179,7 +177,7 @@ for node_class in nodes:
|
||||
node_class.DESCRIPTION = node_class.__doc__
|
||||
if MTB_EXPORT:
|
||||
wiki_name = classname_to_wiki(class_name)
|
||||
(wiki / "nodes" / (wiki_name + ".md")).write_text(
|
||||
_ = (wiki / "nodes" / (wiki_name + ".md")).write_text(
|
||||
node_class.__doc__, encoding="utf-8"
|
||||
)
|
||||
|
||||
@@ -192,12 +190,15 @@ for node_class in nodes:
|
||||
NODE_CLASS_MAPPINGS[node_label] = node_class
|
||||
NODE_DISPLAY_NAME_MAPPINGS[class_name] = node_label
|
||||
NODE_CLASS_MAPPINGS_DEBUG[node_label] = node_class.__doc__
|
||||
# TODO: I removed this, I find it more convenient to write without spaces, but it breaks every of my workflows
|
||||
# TODO (cont): and until I find a way to automate the conversion, I'll leave it like this
|
||||
|
||||
# TODO: I removed this, I find it more convenient to write without spaces
|
||||
# but it breaks every of my workflows
|
||||
# TODO (cont): and until I find a way to automate the conversion
|
||||
# I'll leave it like this
|
||||
|
||||
if os.environ.get("MTB_EXPORT"):
|
||||
with open(here / "node_list.json", "w") as f:
|
||||
f.write(
|
||||
_ = f.write(
|
||||
json.dumps(
|
||||
{
|
||||
k: NODE_CLASS_MAPPINGS_DEBUG[k]
|
||||
@@ -215,19 +216,30 @@ log.debug(
|
||||
)
|
||||
)
|
||||
|
||||
log.info(f"loaded {cyan_text(len(nodes))} nodes successfuly")
|
||||
log.info(f"loaded {cyan_text(str(len(nodes)))} nodes successfuly")
|
||||
|
||||
if failed:
|
||||
with contextlib.suppress(Exception):
|
||||
base_url, port = utils.get_server_info()
|
||||
log.info(
|
||||
f"Some nodes ({len(failed)}) could not be loaded. This can be ignored, but go to http://{base_url}:{port}/mtb if you want more information."
|
||||
)
|
||||
log.debug(failed)
|
||||
|
||||
|
||||
# - ENDPOINT
|
||||
|
||||
|
||||
if hasattr(PromptServer, "instance"):
|
||||
img_cache = None
|
||||
prompt_cache = None
|
||||
|
||||
with contextlib.suppress(ImportError):
|
||||
from cachetools import TTLCache
|
||||
|
||||
img_cache = TTLCache(maxsize=100, ttl=5) # 1 min TTL
|
||||
prompt_cache = TTLCache(maxsize=100, ttl=5) # 1 min TTL
|
||||
|
||||
restore_deps = ["basicsr"]
|
||||
onnx_deps = ["onnxruntime"]
|
||||
swap_deps = ["insightface"] + onnx_deps
|
||||
@@ -306,10 +318,10 @@ if hasattr(PromptServer, "instance"):
|
||||
}
|
||||
)
|
||||
|
||||
@PromptServer.instance.routes.post("/mtb/debug")
|
||||
async def set_debug(request):
|
||||
json_data = await request.json()
|
||||
enabled = json_data.get("enabled")
|
||||
@PromptServer.instance.routes.post("/mtb/server-info")
|
||||
async def set_server_info(request: Request):
|
||||
json_data: dict[str, bool] = await request.json()
|
||||
enabled = json_data.get("debug")
|
||||
if enabled:
|
||||
os.environ["MTB_DEBUG"] = "true"
|
||||
log.setLevel(logging.DEBUG)
|
||||
@@ -317,7 +329,7 @@ if hasattr(PromptServer, "instance"):
|
||||
|
||||
elif "MTB_DEBUG" in os.environ:
|
||||
# del os.environ["MTB_DEBUG"]
|
||||
os.environ.pop("MTB_DEBUG")
|
||||
_ = os.environ.pop("MTB_DEBUG")
|
||||
log.setLevel(logging.INFO)
|
||||
|
||||
return web.json_response(
|
||||
@@ -325,17 +337,17 @@ if hasattr(PromptServer, "instance"):
|
||||
)
|
||||
|
||||
@PromptServer.instance.routes.get("/mtb")
|
||||
async def get_home(request):
|
||||
async def get_home(request: Request):
|
||||
from . import endpoint
|
||||
|
||||
reload(endpoint)
|
||||
_ = reload(endpoint)
|
||||
# Check if the request prefers HTML content
|
||||
if "text/html" in request.headers.get("Accept", ""):
|
||||
# # Return an HTML page
|
||||
html_response = """
|
||||
<div class="flex-container menu">
|
||||
<a href="/mtb/manage">manage</a>
|
||||
<a href="/mtb/debug">debug</a>
|
||||
<a href="/mtb/server-info">Server Info</a>
|
||||
<a href="/mtb/status">status</a>
|
||||
</div>
|
||||
"""
|
||||
@@ -347,28 +359,176 @@ if hasattr(PromptServer, "instance"):
|
||||
# Return JSON for other requests
|
||||
return web.json_response({"message": "Welcome to MTB!"})
|
||||
|
||||
@PromptServer.instance.routes.get("/mtb/debug")
|
||||
async def get_debug(request):
|
||||
import asyncio
|
||||
import os
|
||||
from io import BytesIO
|
||||
|
||||
from aiohttp import web
|
||||
from PIL import Image
|
||||
|
||||
def get_cached_image(file_path: str, preview_params=None, channel=None):
|
||||
cache_key = (file_path, preview_params, channel)
|
||||
if img_cache and (cache_key in img_cache):
|
||||
return img_cache[cache_key]
|
||||
|
||||
with Image.open(file_path) as img:
|
||||
info = img.info
|
||||
if preview_params:
|
||||
img = process_preview(img, preview_params)
|
||||
if channel:
|
||||
img = process_channel(img, channel)
|
||||
if prompt_cache:
|
||||
prompt_cache[cache_key] = info
|
||||
if img_cache:
|
||||
img_cache[cache_key] = img.getvalue()
|
||||
return img_cache[cache_key]
|
||||
|
||||
return img.getvalue()
|
||||
|
||||
def process_preview(img: Image.Image, preview_params):
|
||||
image_format, quality, width = preview_params
|
||||
quality = int(quality)
|
||||
|
||||
if width:
|
||||
width = int(width)
|
||||
img.thumbnail((width, int(width * img.height / img.width)))
|
||||
|
||||
buffer = BytesIO()
|
||||
img.save(
|
||||
buffer, format=image_format, quality=quality, metadata=img.info
|
||||
)
|
||||
buffer.seek(0)
|
||||
return buffer
|
||||
|
||||
def process_channel(img: Image.Image, channel: str):
|
||||
if channel == "rgb":
|
||||
if img.mode == "RGBA":
|
||||
r, g, b, _ = img.split()
|
||||
img = Image.merge("RGB", (r, g, b))
|
||||
else:
|
||||
img = img.convert("RGB")
|
||||
elif channel == "a":
|
||||
if img.mode == "RGBA":
|
||||
_, _, _, a = img.split()
|
||||
else:
|
||||
a = Image.new("L", img.size, 255)
|
||||
img = Image.new("RGBA", img.size)
|
||||
img.putalpha(a)
|
||||
|
||||
buffer = BytesIO()
|
||||
img.save(buffer, format="PNG")
|
||||
_ = buffer.seek(0)
|
||||
return buffer
|
||||
|
||||
async def get_image_response(
|
||||
file, filename: str, preview_info=None, channel=None
|
||||
):
|
||||
img = await asyncio.to_thread(
|
||||
get_cached_image, file, preview_info, channel
|
||||
)
|
||||
return web.Response(
|
||||
body=img,
|
||||
content_type="image/webp" if preview_info else "image/png",
|
||||
headers={"Content-Disposition": f'filename="{filename}"'},
|
||||
)
|
||||
|
||||
# TODO: Embed the metadatas somehow so we can drag and drop
|
||||
# to load workflows in the sidebar
|
||||
@PromptServer.instance.routes.get("/mtb/view")
|
||||
async def view_image(request: Request):
|
||||
import folder_paths
|
||||
|
||||
filename = request.rel_url.query.get("filename")
|
||||
if not filename:
|
||||
return web.Response(status=404)
|
||||
|
||||
filename, output_dir = folder_paths.annotated_filepath(filename)
|
||||
if filename[0] == "/" or ".." in filename:
|
||||
return web.Response(status=400)
|
||||
|
||||
if output_dir is None:
|
||||
rtype = request.rel_url.query.get("type", "output")
|
||||
output_dir = folder_paths.get_directory_by_type(rtype)
|
||||
|
||||
if output_dir is None:
|
||||
return web.Response(status=400)
|
||||
|
||||
if "subfolder" in request.rel_url.query:
|
||||
full_output_dir = os.path.join(
|
||||
output_dir, request.rel_url.query["subfolder"]
|
||||
)
|
||||
if (
|
||||
os.path.commonpath(
|
||||
(os.path.abspath(full_output_dir), output_dir)
|
||||
)
|
||||
!= output_dir
|
||||
):
|
||||
return web.Response(status=403)
|
||||
output_dir = full_output_dir
|
||||
|
||||
filename = os.path.basename(filename)
|
||||
file = os.path.join(output_dir, filename)
|
||||
|
||||
if not os.path.isfile(file):
|
||||
return web.Response(status=404)
|
||||
|
||||
preview_info = None
|
||||
if "preview" in request.rel_url.query:
|
||||
preview_params = request.rel_url.query["preview"].split(";")
|
||||
image_format = (
|
||||
preview_params[0]
|
||||
if preview_params[0] in ["webp", "jpeg"]
|
||||
else "webp"
|
||||
)
|
||||
quality = (
|
||||
int(preview_params[1])
|
||||
if len(preview_params) > 1 and preview_params[1].isdigit()
|
||||
else 90
|
||||
)
|
||||
width = request.rel_url.query.get("width")
|
||||
preview_info = (image_format, quality, width)
|
||||
|
||||
channel = request.rel_url.query.get("channel")
|
||||
|
||||
return await get_image_response(file, filename, preview_info, channel)
|
||||
|
||||
@PromptServer.instance.routes.get("/mtb/server-info")
|
||||
async def get_debug(request: Request):
|
||||
from . import endpoint
|
||||
|
||||
reload(endpoint)
|
||||
enabled = "MTB_DEBUG" in os.environ
|
||||
_ = reload(endpoint)
|
||||
isdebug = "MTB_DEBUG" in os.environ
|
||||
exposed = "MTB_EXPOSE" in os.environ
|
||||
|
||||
def render_property(name: str, val: str):
|
||||
return f"""<strong>{name}:</strong>
|
||||
<p>
|
||||
{val}
|
||||
</p>"""
|
||||
|
||||
# Check if the request prefers HTML content
|
||||
if "text/html" in request.headers.get("Accept", ""):
|
||||
# # Return an HTML page
|
||||
html_response = f"""
|
||||
<h1>MTB Debug Status: {'Enabled' if enabled else 'Disabled'}</h1>
|
||||
"""
|
||||
html_response = ""
|
||||
|
||||
html_response += render_property(
|
||||
"Debug", "Enabled" if isdebug else "Disabled"
|
||||
)
|
||||
|
||||
html_response += render_property("Exposed", str(exposed))
|
||||
|
||||
return web.Response(
|
||||
text=endpoint.render_base_template("Debug", html_response),
|
||||
text=endpoint.render_base_template(
|
||||
"Server Info", html_response
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
# Return JSON for other requests
|
||||
return web.json_response({"enabled": enabled})
|
||||
return web.json_response({"exposed": exposed, "debug": isdebug})
|
||||
|
||||
@PromptServer.instance.routes.get("/mtb/actions")
|
||||
async def no_route(request):
|
||||
async def no_route(request: Request):
|
||||
from . import endpoint
|
||||
|
||||
if "text/html" in request.headers.get("Accept", ""):
|
||||
@@ -382,7 +542,7 @@ if hasattr(PromptServer, "instance"):
|
||||
return web.json_response({"message": "actions has no get for now"})
|
||||
|
||||
@PromptServer.instance.routes.post("/mtb/actions")
|
||||
async def do_action(request):
|
||||
async def do_action(request: Request):
|
||||
from . import endpoint
|
||||
|
||||
reload(endpoint)
|
||||
|
||||
+169
-15
@@ -1,11 +1,21 @@
|
||||
import csv
|
||||
import secrets
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Literal
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
from .log import mklog
|
||||
from .utils import (
|
||||
SortMode,
|
||||
backup_file,
|
||||
build_glob_patterns,
|
||||
glob_multiple,
|
||||
here,
|
||||
import_install,
|
||||
input_dir,
|
||||
output_dir,
|
||||
reqs_map,
|
||||
run_command,
|
||||
styles_dir,
|
||||
@@ -14,15 +24,100 @@ from .utils import (
|
||||
endlog = mklog("mtb endpoint")
|
||||
|
||||
# - ACTIONS
|
||||
import asyncio
|
||||
import platform
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
import websockets.server
|
||||
except ModuleNotFoundError:
|
||||
endlog.warning(
|
||||
"You do not have websockets installed, the video server won't work"
|
||||
)
|
||||
websockets = False
|
||||
|
||||
import_install("requirements")
|
||||
import io
|
||||
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
|
||||
|
||||
def generate_random_frame():
|
||||
# Generate a random image frame
|
||||
width, height = 640, 480
|
||||
image = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)
|
||||
pil_image = Image.fromarray(image)
|
||||
byte_buffer = io.BytesIO()
|
||||
pil_image.save(byte_buffer, format="JPEG")
|
||||
frame_data = byte_buffer.getvalue()
|
||||
return frame_data
|
||||
|
||||
|
||||
class VideoStreamingManager:
|
||||
def __init__(self):
|
||||
self.video_servers = {}
|
||||
self.next_port = (
|
||||
8767 # Start with a default port and increment for each server
|
||||
)
|
||||
|
||||
async def start_video_streaming_server(self, video_id):
|
||||
if video_id not in self.video_servers:
|
||||
# Create and start a new video streaming server for the specified video
|
||||
video_server = await self.create_video_streaming_server(video_id)
|
||||
self.video_servers[video_id] = video_server
|
||||
|
||||
return video_server
|
||||
|
||||
async def video_stream(self, websocket, path):
|
||||
# Implement the logic to continuously capture and send video frames here
|
||||
while True:
|
||||
# frame_data = capture_and_encode_frame() # Implement this function
|
||||
frame_data = generate_random_frame()
|
||||
await websocket.send(frame_data)
|
||||
await asyncio.sleep(0.033) # Adjust the frame rate as needed
|
||||
|
||||
async def create_video_streaming_server(self, video_id):
|
||||
# Create and start a new WebSocket server for the specified video
|
||||
port = self.next_port
|
||||
self.next_port += 1 # Increment port number for the next server
|
||||
|
||||
server = await websockets.server.serve(
|
||||
self.video_stream, "localhost", port
|
||||
)
|
||||
|
||||
return server
|
||||
|
||||
async def stop_video_streaming_server(self, video_id):
|
||||
if video_id in self.video_servers:
|
||||
# Terminate and remove the video streaming server for the specified video
|
||||
video_server = self.video_servers[video_id]
|
||||
video_server.close()
|
||||
await video_server.wait_closed()
|
||||
del self.video_servers[video_id]
|
||||
|
||||
|
||||
async def start_video_streaming_server():
|
||||
async def video_stream(websocket, path):
|
||||
# Continuously capture and send video frames here
|
||||
while True:
|
||||
frame_data = capture_and_encode_frame() # Implement this function
|
||||
await websocket.send(frame_data)
|
||||
await asyncio.sleep(0.033) # Adjust the frame rate as needed
|
||||
|
||||
start_server = websockets.server.serve(
|
||||
video_stream, "localhost", 8766
|
||||
) # Use a different port (e.g., 8766)
|
||||
|
||||
return await start_server
|
||||
|
||||
|
||||
def ACTIONS_installDependency(dependency_names=None):
|
||||
if dependency_names is None:
|
||||
# return web.Response(text="No dependency name provided", status=400)
|
||||
return {"error": "No dependency name provided"}
|
||||
|
||||
endlog.debug(f"Received Install Dependency request for {dependency_names}")
|
||||
# reqs = []
|
||||
resolved_names = [reqs_map.get(name, name) for name in dependency_names]
|
||||
@@ -50,6 +145,50 @@ def ACTIONS_installDependency(dependency_names=None):
|
||||
# break
|
||||
|
||||
|
||||
def ACTIONS_getUserImages(
|
||||
mode: Literal["input", "output"],
|
||||
count=200,
|
||||
offset=0,
|
||||
sort: str | None = None,
|
||||
include_subfolders: bool = False,
|
||||
):
|
||||
# enabled = "MTB_EXPOSE" in os.environ
|
||||
# if not enabled:
|
||||
# return {"error": "Session not authorized to getInputs"}
|
||||
|
||||
imgs = {}
|
||||
entry_dir = input_dir if mode == "input" else output_dir
|
||||
supported = ["png", "jpg", "jpeg", "webp", "gif"]
|
||||
|
||||
entries = {}
|
||||
patterns = build_glob_patterns(supported, recursive=include_subfolders)
|
||||
entries = glob_multiple(entry_dir, patterns)
|
||||
|
||||
sort_mode = SortMode.from_str(sort)
|
||||
|
||||
if sort_mode:
|
||||
sort_key = {
|
||||
SortMode.MODIFIED: lambda x: x.stat().st_mtime,
|
||||
SortMode.MODIFIED_REVERSE: lambda x: x.stat().st_mtime,
|
||||
SortMode.NAME: lambda x: x.name,
|
||||
SortMode.NAME_REVERSE: lambda x: x.name,
|
||||
}.get(sort_mode)
|
||||
if sort_key:
|
||||
reverse = sort_mode in (SortMode.MODIFIED, SortMode.NAME_REVERSE)
|
||||
entries = sorted(entries, key=sort_key, reverse=reverse)
|
||||
|
||||
imgs = {
|
||||
img.name: (
|
||||
f"/mtb/view?filename={img.name}&width=512&type={mode}&subfolder="
|
||||
f"{img.parent.relative_to(entry_dir) if include_subfolders else ''}"
|
||||
f"&preview=&rand={secrets.randbelow(424242)}"
|
||||
)
|
||||
for i, img in enumerate(entries)
|
||||
if offset <= i < offset + count
|
||||
}
|
||||
return imgs
|
||||
|
||||
|
||||
def ACTIONS_getStyles(style_name=None):
|
||||
from .nodes.conditions import MTB_StylesLoader
|
||||
|
||||
@@ -97,7 +236,7 @@ def ACTIONS_saveStyle(data):
|
||||
csv_writer.writerow(row)
|
||||
|
||||
|
||||
async def do_action(request) -> web.Response:
|
||||
async def do_action(request: web.Request) -> web.Response:
|
||||
endlog.debug("Init action request")
|
||||
request_data = await request.json()
|
||||
name = request_data.get("name")
|
||||
@@ -109,7 +248,12 @@ async def do_action(request) -> web.Response:
|
||||
method = globals().get(method_name)
|
||||
|
||||
if callable(method):
|
||||
result = method(args) if args else method()
|
||||
result = None
|
||||
if args:
|
||||
result = method(*args) if isinstance(args, list) else method(args)
|
||||
else:
|
||||
result = method()
|
||||
|
||||
endlog.debug(f"Action result: {result}")
|
||||
return web.json_response({"result": result})
|
||||
|
||||
@@ -130,10 +274,13 @@ async def do_action(request) -> web.Response:
|
||||
# - HTML UTILS
|
||||
|
||||
|
||||
def dependencies_button(name, dependencies):
|
||||
def dependencies_button(name: str, dependencies: list[str]) -> str:
|
||||
deps = ",".join([f"'{x}'" for x in dependencies])
|
||||
return f"""
|
||||
<button class="dependency-button" onclick="window.mtb_action('installDependency',[{deps}])">Install {name} deps</button>
|
||||
<button
|
||||
class="dependency-button"
|
||||
onclick="window.mtb_action('installDependency',[{deps}])"
|
||||
>Install {name} deps</button>
|
||||
"""
|
||||
|
||||
|
||||
@@ -153,7 +300,7 @@ def csv_editor():
|
||||
html_out = """
|
||||
<div id="style-editor">
|
||||
<h1>Style Editor</h1>
|
||||
|
||||
|
||||
"""
|
||||
for current, styles in style_files.items():
|
||||
current_out = f"<h3>{current}</h3>"
|
||||
@@ -215,11 +362,14 @@ def render_tab_view(**kwargs):
|
||||
"""
|
||||
|
||||
|
||||
def add_foldable_region(title, content):
|
||||
def add_foldable_region(title: str, content: str):
|
||||
symbol_id = f"{title}-symbol"
|
||||
return f"""
|
||||
<div class='foldable'>
|
||||
<div class='foldable-title' onclick="toggleFoldable('{title}', '{symbol_id}')">
|
||||
<div
|
||||
class='foldable-title'
|
||||
onclick="toggleFoldable('{title}', '{symbol_id}')"
|
||||
>
|
||||
<span id='{symbol_id}' class='foldable-symbol'>▷</span>
|
||||
{title}
|
||||
</div>
|
||||
@@ -231,7 +381,9 @@ def add_foldable_region(title, content):
|
||||
"""
|
||||
|
||||
|
||||
def add_split_pane(left_content, right_content, vertical=True):
|
||||
def add_split_pane(
|
||||
left_content: str, right_content: str, *, vertical: bool = True
|
||||
):
|
||||
orientation = "vertical" if vertical else "horizontal"
|
||||
return f"""
|
||||
<div class="split-pane {orientation}">
|
||||
@@ -262,13 +414,13 @@ def add_dropdown(title, options):
|
||||
"""
|
||||
|
||||
|
||||
def render_table(table_dict, sort=True, title=None):
|
||||
table_dict = sorted(
|
||||
def render_table(table_dict: dict[str, Any], sort=True, title=None):
|
||||
table_list = sorted(
|
||||
table_dict.items(), key=lambda item: item[0]
|
||||
) # Sort the dictionary by keys
|
||||
|
||||
table_rows = ""
|
||||
for name, item in table_dict:
|
||||
for name, item in table_list:
|
||||
if isinstance(item, dict):
|
||||
if "dependencies" in item:
|
||||
table_rows += f"<tr><td>{name}</td><td>"
|
||||
@@ -299,12 +451,12 @@ def render_table(table_dict, sort=True, title=None):
|
||||
<tbody>
|
||||
{table_rows}
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
"""
|
||||
|
||||
|
||||
def render_base_template(title, content):
|
||||
def render_base_template(title: str, content: str):
|
||||
github_icon_svg = """<svg xmlns="http://www.w3.org/2000/svg" fill="whitesmoke" height="3em" viewBox="0 0 496 512"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>"""
|
||||
return f"""
|
||||
<!DOCTYPE html>
|
||||
@@ -340,7 +492,9 @@ def render_base_template(title, content):
|
||||
<header>
|
||||
<a href="/">Back to Comfy</a>
|
||||
<div class="mtb_logo">
|
||||
<img src="https://repository-images.githubusercontent.com/649047066/a3eef9a7-20dd-4ef9-b839-884502d4e873" alt="Comfy MTB Logo" height="70" width="128">
|
||||
<img
|
||||
src="https://repository-images.githubusercontent.com/649047066/a3eef9a7-20dd-4ef9-b839-884502d4e873"
|
||||
alt="Comfy MTB Logo" height="70" width="128">
|
||||
<span class="title">Comfy MTB</span></div>
|
||||
<a style="width:128px;text-align:center" href="https://www.github.com/melmass/comfy_mtb">
|
||||
{github_icon_svg}
|
||||
@@ -355,6 +509,6 @@ def render_base_template(title, content):
|
||||
<!-- Shared footer content here -->
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,85 @@
|
||||
# NOTE: This file is only use for development you can ignore it
|
||||
|
||||
|
||||
# NOTE: for CI it's easier to extract parts of my cli for now
|
||||
|
||||
const THREE_VERSION = "0.171.0"
|
||||
# Update the external web extensions
|
||||
export def "comfy mtb update-web" [] {
|
||||
|
||||
let async_dir = $"($env.COMFY_MTB)/web_async"
|
||||
let three_base = $"https://cdn.jsdelivr.net/npm/three@($THREE_VERSION)"
|
||||
let three = {
|
||||
"." : [
|
||||
"build/three.module.js",
|
||||
"build/three.core.js",
|
||||
],
|
||||
three_addons/capabilities: [
|
||||
"examples/jsm/capabilities/WebGPU.js",
|
||||
"examples/jsm/controls/ArcballControls.js",
|
||||
"examples/jsm/controls/DragControls.js",
|
||||
"examples/jsm/controls/FirstPersonControls.js",
|
||||
"examples/jsm/controls/FlyControls.js",
|
||||
"examples/jsm/controls/MapControls.js",
|
||||
"examples/jsm/controls/OrbitControls.js",
|
||||
"examples/jsm/controls/PointerLockControls.js",
|
||||
"examples/jsm/controls/TrackballControls.js",
|
||||
"examples/jsm/controls/TransformControls.js",
|
||||
],
|
||||
three_addons/offscreen: [
|
||||
"jank.js",
|
||||
"offscreen.js",
|
||||
"scene.js",
|
||||
],
|
||||
thee_addons/exporters : [
|
||||
"examples/jsm/exporters/DRACOExporter.js",
|
||||
"examples/jsm/exporters/EXRExporter.js",
|
||||
"examples/jsm/exporters/GLTFExporter.js",
|
||||
"examples/jsm/exporters/KTX2Exporter.js",
|
||||
"examples/jsm/exporters/MMDExporter.js",
|
||||
"examples/jsm/exporters/OBJExporter.js",
|
||||
"examples/jsm/exporters/PLYExporter.js",
|
||||
"examples/jsm/exporters/STLExporter.js",
|
||||
"examples/jsm/exporters/USDZExporter.js"
|
||||
],
|
||||
|
||||
three_addons/loaders : [
|
||||
"examples/jsm/loaders/3DMLoader.js",
|
||||
"examples/jsm/loaders/BVHLoader.js",
|
||||
"examples/jsm/loaders/ColladaLoader.js",
|
||||
"examples/jsm/loaders/DRACOLoader.js",
|
||||
"examples/jsm/loaders/EXRLoader.js",
|
||||
"examples/jsm/loaders/FBXLoader.js",
|
||||
"examples/jsm/loaders/FontLoader.js",
|
||||
"examples/jsm/loaders/GLTFLoader.js",
|
||||
"examples/jsm/loaders/HDRCubeTextureLoader.js",
|
||||
"examples/jsm/loaders/MaterialXLoader.js",
|
||||
"examples/jsm/loaders/MTLLoader.js",
|
||||
"examples/jsm/loaders/OBJLoader.js",
|
||||
"examples/jsm/loaders/PCDLoader.js",
|
||||
"examples/jsm/loaders/PDBLoader.js",
|
||||
"examples/jsm/loaders/PLYLoader.js",
|
||||
"examples/jsm/loaders/STLLoader.js",
|
||||
"examples/jsm/loaders/UltraHDRLoader.js",
|
||||
"examples/jsm/loaders/USDZLoader.js",
|
||||
"examples/jsm/loaders/VOXLoader.js"
|
||||
]
|
||||
}
|
||||
$three | items {|root,urls|
|
||||
let dest = $async_dir | path join $root
|
||||
mkdir $dest
|
||||
|
||||
$urls | par-each {|url|
|
||||
let url = $"($three_base)/($url)"
|
||||
let local = ($dest | path join ($url | path basename))
|
||||
wget -c $url -O ($local)
|
||||
}
|
||||
}
|
||||
|
||||
# $three
|
||||
}
|
||||
|
||||
|
||||
def get_root [--clean] {
|
||||
if $clean {
|
||||
$env.COMFY_CLEAN_ROOT
|
||||
@@ -27,7 +107,7 @@ export def "comfy start" [--clean,--old-ui, --listen] {
|
||||
|
||||
let root = get_root --clean=($clean)
|
||||
cd $root
|
||||
MTB_DEBUG=true python main.py --port 3000 ...(if $old_ui { ["--front-end-version", "Comfy-Org/ComfyUI_legacy_frontend@latest"]} else {[]}) --preview-method auto ...(if $listen {["--listen"]} else {[]})
|
||||
MTB_DEBUG=true python main.py --port 3000 ...(if $old_ui { ["--front-end-version", "Comfy-Org/ComfyUI_legacy_frontend@latest"]} else {[ --front-end-version Comfy-Org/ComfyUI_frontend@latest]}) --preview-method auto ...(if $listen {["--listen"]} else {[]})
|
||||
}
|
||||
|
||||
# update comfy itself and merge master in current branch
|
||||
@@ -67,8 +147,14 @@ export def "comfy update" [
|
||||
git checkout master
|
||||
|
||||
print $"(ansi yellow_italic)Fetching and pulling remote updates(ansi reset)"
|
||||
git fetch
|
||||
git pull
|
||||
if ($clean) {
|
||||
git fetch local master
|
||||
git pull local master
|
||||
} else {
|
||||
git fetch
|
||||
git pull
|
||||
}
|
||||
|
||||
|
||||
print $"(ansi yellow_italic)Back to our branch \(($branch_name)\)(ansi reset)"
|
||||
git checkout -
|
||||
@@ -135,7 +221,7 @@ export def "comfy update_extensions" [--clean] {
|
||||
let root = get_root --clean=($clean)
|
||||
cd $root
|
||||
cd custom_nodes
|
||||
git multipull .
|
||||
git multipull . -s -q
|
||||
}
|
||||
|
||||
def --env path-add [pth] {
|
||||
@@ -145,8 +231,8 @@ def --env path-add [pth] {
|
||||
|
||||
|
||||
export-env {
|
||||
$env.COMFY_MTB = ("." | path expand)
|
||||
$env.CUDA_ROOT = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\'
|
||||
$env.COMFY_MTB = ("." | path expand | str replace -a '\' '/')
|
||||
# $env.CUDA_ROOT = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\'
|
||||
|
||||
$env.CUDA_HOME = $env.CUDA_ROOT
|
||||
|
||||
|
||||
@@ -7,11 +7,15 @@ base_log_level = logging.DEBUG if os.environ.get("MTB_DEBUG") else logging.INFO
|
||||
|
||||
# Custom object that discards the output
|
||||
class NullWriter:
|
||||
"""Custom object that discards the output."""
|
||||
|
||||
def write(self, text):
|
||||
pass
|
||||
|
||||
|
||||
class Formatter(logging.Formatter):
|
||||
class ConsoleFormatter(logging.Formatter):
|
||||
"""Formatter for console based log, using base ansi colors."""
|
||||
|
||||
grey = "\x1b[38;20m"
|
||||
cyan = "\x1b[36;20m"
|
||||
purple = "\x1b[35;20m"
|
||||
@@ -19,24 +23,39 @@ class Formatter(logging.Formatter):
|
||||
red = "\x1b[31;20m"
|
||||
bold_red = "\x1b[31;1m"
|
||||
reset = "\x1b[0m"
|
||||
# format = "%(asctime)s - [%(name)s] - %(levelname)s - %(message)s (%(filename)s:%(lineno)d)"
|
||||
format = "[%(name)s] | %(levelname)s -> %(message)s"
|
||||
# format = ("%(asctime)s - [%(name)s] - %(levelname)s "
|
||||
# "- %(message)s (%(filename)s:%(lineno)d)")
|
||||
fmt = "[%(name)s] | %(levelname)s -> %(message)s"
|
||||
|
||||
FORMATS = {
|
||||
logging.DEBUG: purple + format + reset,
|
||||
logging.INFO: cyan + format + reset,
|
||||
logging.WARNING: yellow + format + reset,
|
||||
logging.ERROR: red + format + reset,
|
||||
logging.CRITICAL: bold_red + format + reset,
|
||||
logging.DEBUG: f"{purple}{fmt}{reset}",
|
||||
logging.INFO: f"{cyan}{fmt}{reset}",
|
||||
logging.WARNING: f"{yellow}{fmt}{reset}",
|
||||
logging.ERROR: f"{red}{fmt}{reset}",
|
||||
logging.CRITICAL: f"{bold_red}{fmt}{reset}",
|
||||
}
|
||||
|
||||
def format(self, record):
|
||||
log_fmt = self.FORMATS.get(record.levelno)
|
||||
|
||||
formatter = logging.Formatter(log_fmt)
|
||||
return formatter.format(record)
|
||||
|
||||
|
||||
def mklog(name: str, level: int = base_log_level):
|
||||
class FileFormatter(logging.Formatter):
|
||||
"""Formatter for file base logs."""
|
||||
|
||||
# File specific formatting
|
||||
fmt = (
|
||||
"%(asctime)s - [%(name)s] - "
|
||||
"%(levelname)s - %(message)s (%(filename)s:%(lineno)d)"
|
||||
)
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(self.fmt, "%Y-%m-%d %H:%M:%S")
|
||||
|
||||
|
||||
def mklog(name: str, level: int = base_log_level, log_file: str | None = None):
|
||||
logger = logging.getLogger(name)
|
||||
logger.setLevel(level)
|
||||
|
||||
@@ -45,9 +64,16 @@ def mklog(name: str, level: int = base_log_level):
|
||||
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(level)
|
||||
ch.setFormatter(Formatter())
|
||||
ch.setFormatter(ConsoleFormatter())
|
||||
logger.addHandler(ch)
|
||||
|
||||
if log_file:
|
||||
# file handler
|
||||
fh = logging.FileHandler(log_file)
|
||||
fh.setLevel(level)
|
||||
fh.setFormatter(FileFormatter())
|
||||
logger.addHandler(fh)
|
||||
|
||||
# Disable log propagation
|
||||
logger.propagate = False
|
||||
|
||||
|
||||
+20
-3
@@ -23,12 +23,20 @@
|
||||
"Film Interpolation (mtb)": "Google Research FILM frame interpolation for large motion",
|
||||
"Fit Number (mtb)": "Fit the input float using a source and target range",
|
||||
"Float To Number (mtb)": "Node addon for the WAS Suite. Converts a \"comfy\" FLOAT to a NUMBER.",
|
||||
"Geometry Box (mtb)": "Makes a Box 3D geometry",
|
||||
"Geometry Decimater (mtb)": "Optimized the geometry to match the target number of triangles",
|
||||
"Geometry Info (mtb)": "Retrieve information about a 3D geometry",
|
||||
"Geometry Sphere (mtb)": "Makes a Sphere 3D geometry",
|
||||
"Geometry Test (mtb)": "Fetches an Open3D data geometry",
|
||||
"Get Batch From History (mtb)": "Very experimental node to load images from the history of the server.\n\n Queue items without output are ignored in the count.",
|
||||
"Image Compare (mtb)": "Compare two images and return a difference image",
|
||||
"Image Distort With Uv (mtb)": "Distorts an image based on a UV map.",
|
||||
"Image Premultiply (mtb)": "Premultiply image with mask",
|
||||
"Image Remove Background Rembg (mtb)": "Removes the background from the input using Rembg.",
|
||||
"Image Resize Factor (mtb)": "Extracted mostly from WAS Node Suite, with a few edits (most notably multiple image support) and less features.",
|
||||
"Image Tile Offset (mtb)": "Mimics an old photoshop technique to check for seamless textures",
|
||||
"Image To Uv (mtb)": "Turn an image back into a UV map. (Shallow converter)",
|
||||
"Image Tile Offset (mtb)": "Mimics an old photoshop technique to check for seamless textures",
|
||||
"Int To Bool (mtb)": "Basic int to bool conversion",
|
||||
"Int To Number (mtb)": "Node addon for the WAS Suite. Converts a \"comfy\" INT to a NUMBER.",
|
||||
"Interpolate Clip Sequential (mtb)": null,
|
||||
@@ -37,12 +45,14 @@
|
||||
"Load Face Enhance Model (mtb)": "Loads a GFPGan or RestoreFormer model for face enhancement.",
|
||||
"Load Face Swap Model (mtb)": "Loads a faceswap model",
|
||||
"Load Film Model (mtb)": "Loads a FILM model",
|
||||
"Load Geometry (mtb)": "Load a 3D geometry",
|
||||
"Load Image From Url (mtb)": "Load an image from the given URL",
|
||||
"Load Image Sequence (mtb)": "Load an image sequence from a folder. The current frame is used to determine which image to load.\n\n Usually used in conjunction with the `Primitive` node set to increment to load a sequence of images from a folder.\n Use -1 to load all matching frames as a batch.\n ",
|
||||
"Mask To Image (mtb)": "Converts a mask (alpha) to an RGB image with a color and background",
|
||||
"Model Patch Seamless (mtb)": "Experimental patcher to enable the circular padding mode of the sd model layers, requires a custom VAE",
|
||||
"Math Expression (mtb)": "Node to evaluate a simple math expression string",
|
||||
"Model Patch Seamless (mtb)": "Uses the stable diffusion 'hack' to infer seamless images by setting the model layers padding mode to circular (experimental)",
|
||||
"Pick From Batch (mtb)": "Pick a specific number of images from a batch, either from the start or end.",
|
||||
"Pick From Batch (mtb)": "Pick a specific number of images from a batch, either from the start or end.",
|
||||
"Qr Code (mtb)": "Basic QR Code generator",
|
||||
"Restore Face (mtb)": "Uses GFPGan to restore faces",
|
||||
"Save Gif (mtb)": "Save the images from the batch as a GIF",
|
||||
@@ -55,8 +65,15 @@
|
||||
"String Replace (mtb)": "Basic string replacement",
|
||||
"Styles Loader (mtb)": "Load csv files and populate a dropdown from the rows (\u00e0 la A111)",
|
||||
"Text To Image (mtb)": "Utils to convert text to image using a font\n\n\n The tool looks for any .ttf file in the Comfy folder hierarchy.\n ",
|
||||
"Transform Geometry (mtb)": "Transforms the input geometry",
|
||||
"Transform Image (mtb)": "Save torch tensors (image, mask or latent) to disk, useful to debug things outside comfy\n\n\n it return a tensor representing the transformed images with the same shape as the input tensor\n ",
|
||||
"Uncrop (mtb)": "Uncrops an image to a given bounding box\n\n The bounding box can be given as a tuple of (x, y, width, height) or as a BBOX type\n The BBOX input takes precedence over the tuple input",
|
||||
"Unsplash Image (mtb)": "Unsplash Image given a keyword and a size",
|
||||
"Vae Decode (mtb)": "Wrapper for the 2 core decoders but also adding the sd seamless hack, taken from: FlyingFireCo/tiled_ksampler"
|
||||
}
|
||||
"Uv Distort (mtb)": "Applies a polar coordinates or wave distortion to the UV map",
|
||||
"Uv Map (mtb)": "Generates a UV Map tensor given a widht and height",
|
||||
"Uv Remove Seams (mtb)": "Blends values near the UV borders to mitigate visible seams.",
|
||||
"Uv Tile (mtb)": "Tiles the UV map based on the specified number of tiles.",
|
||||
"Uv To Image (mtb)": "Converts the UV map to an image. (Shallow converter)",
|
||||
"Vae Decode (mtb)": "Wrapper for the 2 core decoders (nomarl and tiled) but also adding the sd seamless hack, taken from: FlyingFireCo/tiled_ksampler"
|
||||
}
|
||||
|
||||
|
||||
+90
-65
@@ -1,4 +1,5 @@
|
||||
from io import BytesIO
|
||||
from typing import List, Literal, Optional, Tuple, Union
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
@@ -6,7 +7,7 @@ import torch
|
||||
from PIL import Image
|
||||
|
||||
from ..log import log
|
||||
from ..utils import EASINGS, apply_easing, pil2tensor
|
||||
from ..utils import EASINGS, apply_easing, hex_to_rgb, pil2tensor
|
||||
from .transform import MTB_TransformImage
|
||||
|
||||
|
||||
@@ -243,7 +244,7 @@ class MTB_BatchShape:
|
||||
bg_color = hex_to_rgb(bg_color)
|
||||
shade_color = hex_to_rgb(shade_color)
|
||||
res = []
|
||||
for x in range(count):
|
||||
for _x in range(count):
|
||||
# Initialize an image canvas
|
||||
canvas = np.full(
|
||||
(image_height, image_width, 3), bg_color, dtype=np.uint8
|
||||
@@ -259,7 +260,7 @@ class MTB_BatchShape:
|
||||
bottom_right = (center[0] + half_size, center[1] + half_size)
|
||||
cv2.rectangle(mask, top_left, bottom_right, 255, -1)
|
||||
elif shape == "Circle":
|
||||
cv2.circle(mask, center, shape_size // 2, 255, -1)
|
||||
cv2.circle(mask, center, shape_size // 2, 255, -1) # type: ignore
|
||||
elif shape == "Diamond":
|
||||
pts = np.array(
|
||||
[
|
||||
@@ -269,7 +270,7 @@ class MTB_BatchShape:
|
||||
[center[0] - shape_size // 2, center[1]],
|
||||
]
|
||||
)
|
||||
cv2.fillPoly(mask, [pts], 255)
|
||||
cv2.fillPoly(mask, [pts], 255) # type: ignore
|
||||
|
||||
elif shape == "Tube":
|
||||
cv2.ellipse(
|
||||
@@ -410,7 +411,14 @@ class MTB_BatchFloat:
|
||||
RETURN_TYPES = ("FLOATS",)
|
||||
CATEGORY = "mtb/batch"
|
||||
|
||||
def set_floats(self, mode, count, min, max, easing):
|
||||
def set_floats(
|
||||
self,
|
||||
mode: Union[Literal["Steps"], Literal["Single"]] = "Steps",
|
||||
count: int = 1,
|
||||
min: float = 0.0, # noqa: A002
|
||||
max: float = 1.0, # noqa: A002
|
||||
easing: str = "Linear",
|
||||
):
|
||||
if mode == "Steps" and count == 1:
|
||||
raise ValueError(
|
||||
"Steps mode requires at least a count of 2 values"
|
||||
@@ -527,12 +535,12 @@ class MTB_Batch2dTransform:
|
||||
self,
|
||||
image: torch.Tensor,
|
||||
border_handling: str,
|
||||
constant_color: str,
|
||||
x: list[float] | None = None,
|
||||
y: list[float] | None = None,
|
||||
zoom: list[float] | None = None,
|
||||
angle: list[float] | None = None,
|
||||
shear: list[float] | None = None,
|
||||
constant_color: tuple,
|
||||
x: Optional[List[float]] = None,
|
||||
y=None,
|
||||
zoom=None,
|
||||
angle=None,
|
||||
shear=None,
|
||||
):
|
||||
if all(
|
||||
self.get_num_elements(param) <= 0
|
||||
@@ -568,7 +576,8 @@ class MTB_Batch2dTransform:
|
||||
count = len(values)
|
||||
if count > 0 and count != image.shape[0]:
|
||||
raise ValueError(
|
||||
f"Length of {name} values ({count}) must match number of images ({image.shape[0]})"
|
||||
f"Length of {name} values ({count}) must \
|
||||
match number of images ({image.shape[0]})"
|
||||
)
|
||||
if count == 0:
|
||||
keyframes[name] = [default_vals[name]] * image.shape[0]
|
||||
@@ -577,11 +586,11 @@ class MTB_Batch2dTransform:
|
||||
res = [
|
||||
transformer.transform(
|
||||
image[i].unsqueeze(0),
|
||||
keyframes["x"][i],
|
||||
keyframes["y"][i],
|
||||
keyframes["zoom"][i],
|
||||
keyframes["angle"][i],
|
||||
keyframes["shear"][i],
|
||||
keyframes["x"][i], # type: ignore
|
||||
keyframes["y"][i], # type: ignore
|
||||
keyframes["zoom"][i], # type: ignore
|
||||
keyframes["angle"][i], # type: ignore
|
||||
keyframes["shear"][i], # type: ignore
|
||||
border_handling,
|
||||
constant_color,
|
||||
)[0]
|
||||
@@ -689,7 +698,7 @@ class MTB_PlotBatchFloat:
|
||||
|
||||
fig, ax = plt.subplots(figsize=(width / 100, height / 100), dpi=100)
|
||||
fig.set_edgecolor("black")
|
||||
fig.patch.set_facecolor("#2e2e2e")
|
||||
fig.patch.set_facecolor("#2e2e2e") # type: ignore
|
||||
# Setting background color and grid
|
||||
ax.set_facecolor("#2e2e2e") # Dark gray background
|
||||
ax.grid(color="gray", linestyle="-", linewidth=0.5, alpha=0.5)
|
||||
@@ -782,10 +791,7 @@ class MTB_PlotBatchFloat:
|
||||
error = int(dx / 2.0)
|
||||
y = y1
|
||||
ystep = None
|
||||
if y1 < y2:
|
||||
ystep = 1
|
||||
else:
|
||||
ystep = -1
|
||||
ystep = 1 if y1 < y2 else -1
|
||||
for x in range(x1, x2 + 1):
|
||||
coord = (y, x) if is_steep else (x, y)
|
||||
image[coord] = color
|
||||
@@ -798,7 +804,8 @@ class MTB_PlotBatchFloat:
|
||||
image[(x2, y2)] = color
|
||||
|
||||
|
||||
DEFAULT_INTERPOLANT = lambda t: t * t * t * (t * (t * 6 - 15) + 10)
|
||||
def _DEFAULT_INTERPOLANT(t):
|
||||
return t * t * t * (t * (t * 6 - 15) + 10)
|
||||
|
||||
|
||||
class MTB_BatchShake:
|
||||
@@ -832,37 +839,40 @@ class MTB_BatchShake:
|
||||
):
|
||||
"""Generate a 2D numpy array of perlin noise.
|
||||
|
||||
Args:
|
||||
shape: The shape of the generated array (tuple of two ints).
|
||||
Args
|
||||
----
|
||||
|
||||
- shape: The shape of the generated array (tuple of two ints).
|
||||
This must be a multple of res.
|
||||
res: The number of periods of noise to generate along each
|
||||
- res: The number of periods of noise to generate along each
|
||||
axis (tuple of two ints). Note shape must be a multiple of
|
||||
res.
|
||||
tileable: If the noise should be tileable along each axis
|
||||
(tuple of two bools). Defaults to (False, False).
|
||||
interpolant: The interpolation function, defaults to
|
||||
- tileable: If the noise should be tileable along each axis
|
||||
(tuple of two bools). Defaults to (False, False).
|
||||
- interpolant: The interpolation function, defaults to
|
||||
t*t*t*(t*(t*6 - 15) + 10).
|
||||
|
||||
Returns
|
||||
-------
|
||||
A numpy array of shape shape with the generated noise.
|
||||
A numpy array of shape shape with the generated noise.
|
||||
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError: If shape is not a multiple of res.
|
||||
ValueError: If shape is not a multiple of res.
|
||||
"""
|
||||
interpolant = interpolant or DEFAULT_INTERPOLANT
|
||||
interpolant = interpolant or _DEFAULT_INTERPOLANT
|
||||
delta = (res[0] / shape[0], res[1] / shape[1])
|
||||
d = (shape[0] // res[0], shape[1] // res[1])
|
||||
grid = (
|
||||
np.mgrid[0 : res[0] : delta[0], 0 : res[1] : delta[1]].transpose(
|
||||
np.mgrid[0 : res[0] : delta[0], 0 : res[1] : delta[1]].transpose( # type: ignore
|
||||
1, 2, 0
|
||||
)
|
||||
% 1
|
||||
)
|
||||
# Gradients
|
||||
angles = 2 * np.pi * np.random.rand(res[0] + 1, res[1] + 1)
|
||||
gradients = np.dstack((np.cos(angles), np.sin(angles)))
|
||||
gradients = np.dstack((np.cos(angles), np.sin(angles))) # type: ignore
|
||||
if tileable[0]:
|
||||
gradients[-1, :] = gradients[0, :]
|
||||
if tileable[1]:
|
||||
@@ -873,11 +883,12 @@ class MTB_BatchShake:
|
||||
g01 = gradients[: -d[0], d[1] :]
|
||||
g11 = gradients[d[0] :, d[1] :]
|
||||
# Ramps
|
||||
n00 = np.sum(np.dstack((grid[:, :, 0], grid[:, :, 1])) * g00, 2)
|
||||
n10 = np.sum(np.dstack((grid[:, :, 0] - 1, grid[:, :, 1])) * g10, 2)
|
||||
n01 = np.sum(np.dstack((grid[:, :, 0], grid[:, :, 1] - 1)) * g01, 2)
|
||||
n00 = np.sum(np.dstack((grid[:, :, 0], grid[:, :, 1])) * g00, 2) # type: ignore
|
||||
n10 = np.sum(np.dstack((grid[:, :, 0] - 1, grid[:, :, 1])) * g10, 2) # type: ignore
|
||||
n01 = np.sum(np.dstack((grid[:, :, 0], grid[:, :, 1] - 1)) * g01, 2) # type: ignore
|
||||
n11 = np.sum(
|
||||
np.dstack((grid[:, :, 0] - 1, grid[:, :, 1] - 1)) * g11, 2
|
||||
np.dstack((grid[:, :, 0] - 1, grid[:, :, 1] - 1)) * g11, # type: ignore
|
||||
2,
|
||||
)
|
||||
# Interpolation
|
||||
t = interpolant(grid)
|
||||
@@ -897,31 +908,32 @@ class MTB_BatchShake:
|
||||
):
|
||||
"""Generate a 2D numpy array of fractal noise.
|
||||
|
||||
Args:
|
||||
shape: The shape of the generated array (tuple of two ints).
|
||||
This must be a multiple of lacunarity**(octaves-1)*res.
|
||||
res: The number of periods of noise to generate along each
|
||||
axis (tuple of two ints). Note shape must be a multiple of
|
||||
(lacunarity**(octaves-1)*res).
|
||||
octaves: The number of octaves in the noise. Defaults to 1.
|
||||
persistence: The scaling factor between two octaves.
|
||||
lacunarity: The frequency factor between two octaves.
|
||||
tileable: If the noise should be tileable along each axis
|
||||
(tuple of two bools). Defaults to (True,True).
|
||||
interpolant: The, interpolation function, defaults to
|
||||
t*t*t*(t*(t*6 - 15) + 10).
|
||||
Args
|
||||
----
|
||||
- shape: The shape of the generated array (tuple of two ints).
|
||||
This must be a multiple of lacunarity**(octaves-1)*res.
|
||||
- res: The number of periods of noise to generate along each
|
||||
axis (tuple of two ints). Note shape must be a multiple of
|
||||
(lacunarity**(octaves-1)*res).
|
||||
- octaves: The number of octaves in the noise. Defaults to 1.
|
||||
- persistence: The scaling factor between two octaves.
|
||||
- lacunarity: The frequency factor between two octaves.
|
||||
- tileable: If the noise should be tileable along each axis
|
||||
(tuple of two bools). Defaults to (True,True).
|
||||
- interpolant: The, interpolation function, defaults to
|
||||
t*t*t*(t*(t*6 - 15) + 10).
|
||||
|
||||
Returns
|
||||
-------
|
||||
A numpy array of fractal noise and of shape shape generated by
|
||||
combining several octaves of perlin noise.
|
||||
A numpy array of fractal noise and of shape shape generated by
|
||||
combining several octaves of perlin noise.
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError: If shape is not a multiple of
|
||||
(lacunarity**(octaves-1)*res).
|
||||
- `ValueError`:
|
||||
If shape is not a multiple of (lacunarity**(octaves-1)*res).
|
||||
"""
|
||||
interpolant = interpolant or DEFAULT_INTERPOLANT
|
||||
interpolant = interpolant or _DEFAULT_INTERPOLANT
|
||||
|
||||
noise = np.zeros(shape)
|
||||
frequency = 1
|
||||
@@ -938,8 +950,12 @@ class MTB_BatchShake:
|
||||
return noise
|
||||
|
||||
def fbm(self, x, y, octaves):
|
||||
# noise_2d = self.generate_fractal_noise_2d((256, 256), (8, 8), octaves)
|
||||
# Now, extract a single noise value based on x and y, wrapping indices if necessary
|
||||
# noise_2d = self.generate_fractal_noise_2d(
|
||||
# (256, 256),
|
||||
# (8, 8),
|
||||
# octaves)
|
||||
# Now, extract a single noise value based on x and y,
|
||||
# wrapping indices if necessary
|
||||
x_idx = int(x) % 256
|
||||
y_idx = int(y) % 256
|
||||
return self.noise_pattern[x_idx, y_idx]
|
||||
@@ -963,7 +979,8 @@ class MTB_BatchShake:
|
||||
(512, 512), (32, 32), (True, True)
|
||||
)
|
||||
|
||||
# Assuming frame count is derived from the first dimension of images tensor
|
||||
# Assuming frame count is derived from
|
||||
# the first dimension of images tensor
|
||||
frame_count = images.shape[0]
|
||||
|
||||
frequency = frequency / frequency_divider
|
||||
@@ -987,11 +1004,14 @@ class MTB_BatchShake:
|
||||
|
||||
# np_position = np.array(
|
||||
# [
|
||||
# self.fbm(self.position_offset[0] + frame_num, time, octaves),
|
||||
# self.fbm(self.position_offset[1] + frame_num, time, octaves),
|
||||
# self.fbm(self.position_offset[0] +
|
||||
# frame_num, time, octaves),
|
||||
# self.fbm(self.position_offset[1] +
|
||||
# frame_num, time, octaves),
|
||||
# ]
|
||||
# )
|
||||
# np_rotation = self.fbm(self.rotation_offset[2] + frame_num, time, octaves)
|
||||
# np_rotation = self.fbm(self.rotation_offset[2] +
|
||||
# frame_num, time, octaves)
|
||||
|
||||
rot_idx = (self.rotation_offset[2] + frame_num) % 256
|
||||
np_rotation = self.fbm(rot_idx, time, octaves)
|
||||
@@ -1009,14 +1029,19 @@ class MTB_BatchShake:
|
||||
transform = MTB_Batch2dTransform()
|
||||
|
||||
log.debug(
|
||||
f"Applying shaking with parameters: \nposition {position_amount_x}, {position_amount_y}\nrotation {rotation_amount}\nfrequency {frequency}\noctaves {octaves}"
|
||||
f"Applying shaking with parameters: \n \
|
||||
position {position_amount_x}, \
|
||||
{position_amount_y}\nrotation {rotation_amount}\n \
|
||||
frequency {frequency}\noctaves {octaves}"
|
||||
)
|
||||
|
||||
# Apply shaking transformations to images
|
||||
shaken_images = transform.transform_batch(
|
||||
images,
|
||||
border_handling="edge", # Assuming edge handling as default
|
||||
constant_color="#000000", # Assuming black as default constant color
|
||||
# Assuming edge handling as default
|
||||
border_handling="edge",
|
||||
# Assuming black as default constant color
|
||||
constant_color="#000000", # type: ignore
|
||||
x=x_translations,
|
||||
y=y_translations,
|
||||
angle=rotations,
|
||||
|
||||
+123
-1
@@ -3,10 +3,127 @@ import shutil
|
||||
from pathlib import Path
|
||||
|
||||
import folder_paths
|
||||
import torch
|
||||
|
||||
from ..log import log
|
||||
from ..utils import here
|
||||
|
||||
Conditioning = list[tuple[torch.Tensor, dict[str, torch.Tensor]]]
|
||||
|
||||
|
||||
def check_condition(conditioning: Conditioning):
|
||||
has_cn = False
|
||||
if len(conditioning) > 1:
|
||||
log.warn(
|
||||
"More than one conditioning was provided. Only the first one will be used."
|
||||
)
|
||||
first = conditioning[0]
|
||||
cond, kwargs = first
|
||||
|
||||
log.debug("Conditioning Shape")
|
||||
log.debug(cond.shape)
|
||||
log.debug("Conditioning keys")
|
||||
log.debug([f"\t{k} - {type(kwargs[k])}" for k in kwargs])
|
||||
if "control" in kwargs:
|
||||
log.debug("Conditioning contains a controlnet")
|
||||
has_cn = True
|
||||
if "pooled_output" not in kwargs:
|
||||
raise ValueError(
|
||||
"Conditioning is not valid. Missing 'pooled_output' key."
|
||||
)
|
||||
return has_cn
|
||||
|
||||
|
||||
class MTB_InterpolateCondition:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"blend": (
|
||||
"FLOAT",
|
||||
{"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.01},
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("CONDITIONING",)
|
||||
CATEGORY = "mtb/conditioning"
|
||||
FUNCTION = "execute"
|
||||
|
||||
def execute(
|
||||
self, blend: float, **kwargs: Conditioning
|
||||
) -> tuple[Conditioning]:
|
||||
blend = max(0.0, min(1.0, blend))
|
||||
|
||||
conditions: list[Conditioning] = list(kwargs.values())
|
||||
num_conditions = len(conditions)
|
||||
|
||||
if num_conditions < 2:
|
||||
raise ValueError("At least two conditioning inputs are required.")
|
||||
|
||||
segment_length = 1.0 / (num_conditions - 1)
|
||||
|
||||
segment_index = min(int(blend // segment_length), num_conditions - 2)
|
||||
|
||||
local_blend = (
|
||||
blend - (segment_index * segment_length)
|
||||
) / segment_length
|
||||
|
||||
cond_from = conditions[segment_index]
|
||||
cond_to = conditions[segment_index + 1]
|
||||
|
||||
from_cn = check_condition(cond_from)
|
||||
to_cn = check_condition(cond_to)
|
||||
|
||||
if from_cn and to_cn:
|
||||
raise ValueError(
|
||||
"Interpolating conditions cannot both contain ControlNets"
|
||||
)
|
||||
|
||||
try:
|
||||
interpolated_condition = [
|
||||
(1.0 - local_blend) * c_from + local_blend * c_to
|
||||
for c_from, c_to in zip(
|
||||
cond_from[0][0], cond_to[0][0], strict=False
|
||||
)
|
||||
]
|
||||
except Exception as e:
|
||||
print(f"Error during interpolation: {e}")
|
||||
raise
|
||||
|
||||
pooled_from = cond_from[0][1].get(
|
||||
"pooled_output",
|
||||
torch.zeros_like(
|
||||
next(iter(cond_from[0][1].values()), torch.tensor([]))
|
||||
),
|
||||
)
|
||||
|
||||
pooled_to = cond_to[0][1].get(
|
||||
"pooled_output",
|
||||
torch.zeros_like(
|
||||
next(iter(cond_from[0][1].values()), torch.tensor([]))
|
||||
),
|
||||
)
|
||||
|
||||
interpolated_pooled = (
|
||||
1.0 - local_blend
|
||||
) * pooled_from + local_blend * pooled_to
|
||||
|
||||
res = {"pooled_output": interpolated_pooled}
|
||||
|
||||
if from_cn:
|
||||
res["control"] = cond_from[0][1]["control"]
|
||||
res["control_apply_to_uncond"] = cond_from[0][1][
|
||||
"control_apply_to_uncond"
|
||||
]
|
||||
if to_cn:
|
||||
res["control"] = cond_to[0][1]["control"]
|
||||
res["control_apply_to_uncond"] = cond_to[0][1][
|
||||
"control_apply_to_uncond"
|
||||
]
|
||||
|
||||
return ([(torch.stack(interpolated_condition), res)],)
|
||||
|
||||
|
||||
class MTB_InterpolateClipSequential:
|
||||
@classmethod
|
||||
@@ -213,4 +330,9 @@ class MTB_StylesLoader:
|
||||
return (self.options[style_name][0], self.options[style_name][1])
|
||||
|
||||
|
||||
__nodes__ = [MTB_SmartStep, MTB_StylesLoader, MTB_InterpolateClipSequential]
|
||||
__nodes__ = [
|
||||
MTB_SmartStep,
|
||||
MTB_StylesLoader,
|
||||
MTB_InterpolateClipSequential,
|
||||
MTB_InterpolateCondition,
|
||||
]
|
||||
|
||||
+38
-1
@@ -59,6 +59,36 @@ class MTB_SplitBbox:
|
||||
return (bbox[0], bbox[1], bbox[2], bbox[3])
|
||||
|
||||
|
||||
class MTB_UpscaleBboxBy:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"bbox": ("BBOX",),
|
||||
"scale": ("FLOAT", {"default": 1.0}),
|
||||
},
|
||||
}
|
||||
|
||||
CATEGORY = "mtb/crop"
|
||||
RETURN_TYPES = ("BBOX",)
|
||||
|
||||
FUNCTION = "upscale"
|
||||
|
||||
def upscale(
|
||||
self, bbox: tuple[int, int, int, int], scale: float
|
||||
) -> tuple[tuple[int, int, int, int]]:
|
||||
x, y, width, height = bbox
|
||||
# scaled = (x * scale, y * scale, width * scale, height * scale)
|
||||
scaled = (
|
||||
int(x * scale),
|
||||
int(y * scale),
|
||||
int(width * scale),
|
||||
int(height * scale),
|
||||
)
|
||||
|
||||
return (scaled,)
|
||||
|
||||
|
||||
class MTB_BboxFromMask:
|
||||
"""From a mask extract the bounding box"""
|
||||
|
||||
@@ -342,4 +372,11 @@ class MTB_Uncrop:
|
||||
return (pil2tensor(out_images),)
|
||||
|
||||
|
||||
__nodes__ = [MTB_BboxFromMask, MTB_Bbox, MTB_Crop, MTB_Uncrop, MTB_SplitBbox]
|
||||
__nodes__ = [
|
||||
MTB_BboxFromMask,
|
||||
MTB_Bbox,
|
||||
MTB_Crop,
|
||||
MTB_Uncrop,
|
||||
MTB_SplitBbox,
|
||||
MTB_UpscaleBboxBy,
|
||||
]
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ def serialize_curve(curve):
|
||||
return curve
|
||||
|
||||
|
||||
class MTB_Curve:
|
||||
class MTBCurve:
|
||||
"""A basic FLOAT_CURVE input node."""
|
||||
|
||||
@classmethod
|
||||
@@ -90,4 +90,4 @@ class MTB_CurveToFloat:
|
||||
return (interpolated_y_values, interpolated_y_values)
|
||||
|
||||
|
||||
__nodes__ = [MTB_Curve, MTB_CurveToFloat]
|
||||
__nodes__ = [MTBCurve, MTB_CurveToFloat]
|
||||
|
||||
+48
-24
@@ -5,31 +5,22 @@ from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import folder_paths
|
||||
import open3d as o3d
|
||||
import torch
|
||||
|
||||
from ..log import log
|
||||
from ..utils import tensor2pil
|
||||
from ..utils import mesh_to_json, tensor2b64
|
||||
|
||||
|
||||
# region processors
|
||||
def process_tensor(tensor):
|
||||
def process_tensor(tensor: torch.Tensor):
|
||||
log.debug(f"Tensor: {tensor.shape}")
|
||||
|
||||
image = tensor2pil(tensor)
|
||||
b64_imgs = []
|
||||
for im in image:
|
||||
buffered = io.BytesIO()
|
||||
im.save(buffered, format="PNG")
|
||||
b64_imgs.append(
|
||||
"data:image/png;base64,"
|
||||
+ base64.b64encode(buffered.getvalue()).decode("utf-8")
|
||||
)
|
||||
|
||||
return {"b64_images": b64_imgs}
|
||||
return {"b64_images": tensor2b64(tensor)}
|
||||
|
||||
|
||||
def process_list(anything):
|
||||
text = []
|
||||
def process_list(anything: list[object]) -> dict[str, list[str]]:
|
||||
text: list[str] = []
|
||||
if not anything:
|
||||
return {"text": []}
|
||||
|
||||
@@ -41,7 +32,7 @@ def process_list(anything):
|
||||
):
|
||||
text.append(
|
||||
"List of List of Tensors: "
|
||||
f"{first_element[0].shape} (x{len(anything)})"
|
||||
+ f"{first_element[0].shape} (x{len(anything)})"
|
||||
)
|
||||
|
||||
elif isinstance(first_element, torch.Tensor):
|
||||
@@ -54,13 +45,20 @@ def process_list(anything):
|
||||
return {"text": text}
|
||||
|
||||
|
||||
def process_dict(anything):
|
||||
text = []
|
||||
def process_dict(anything: dict[str, dict[str, any]]) -> dict[str, str]:
|
||||
if "mesh" in anything:
|
||||
m = {"geometry": {}}
|
||||
m["geometry"]["mesh"] = mesh_to_json(anything["mesh"])
|
||||
if "material" in anything:
|
||||
m["geometry"]["material"] = anything["material"]
|
||||
return m
|
||||
|
||||
res = []
|
||||
if "samples" in anything:
|
||||
is_empty = (
|
||||
"(empty)" if torch.count_nonzero(anything["samples"]) == 0 else ""
|
||||
)
|
||||
text.append(f"Latent Samples: {anything['samples'].shape} {is_empty}")
|
||||
res.append(f"Latent Samples: {anything['samples'].shape} {is_empty}")
|
||||
|
||||
else:
|
||||
text.append(json.dumps(anything, indent=2))
|
||||
@@ -68,7 +66,7 @@ def process_dict(anything):
|
||||
return {"text": text}
|
||||
|
||||
|
||||
def process_bool(anything):
|
||||
def process_bool(anything: bool) -> dict[str, str]:
|
||||
return {"text": ["True" if anything else "False"]}
|
||||
|
||||
|
||||
@@ -76,6 +74,11 @@ def process_text(anything):
|
||||
return {"text": [str(anything)]}
|
||||
|
||||
|
||||
# NOT USED ANYMORE
|
||||
def process_geometry(anything):
|
||||
return {"geometry": [mesh_to_json(anything)]}
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
|
||||
@@ -98,7 +101,7 @@ class MTB_Debug:
|
||||
|
||||
def do_debug(self, output_to_console: bool, **kwargs):
|
||||
output = {
|
||||
"ui": {"b64_images": [], "text": []},
|
||||
"ui": {"b64_images": [], "text": [], "geometry": []},
|
||||
# "result": ("A"),
|
||||
}
|
||||
|
||||
@@ -107,18 +110,39 @@ class MTB_Debug:
|
||||
list: process_list,
|
||||
dict: process_dict,
|
||||
bool: process_bool,
|
||||
o3d.geometry.Geometry: process_geometry,
|
||||
}
|
||||
if output_to_console:
|
||||
for k, v in kwargs.items():
|
||||
log.info(f"{k}: {v}")
|
||||
|
||||
for anything in kwargs.values():
|
||||
processor = processors.get(type(anything), process_text)
|
||||
|
||||
processor = processors.get(type(anything))
|
||||
if processor is None:
|
||||
if isinstance(anything, o3d.geometry.Geometry):
|
||||
processor = process_geometry
|
||||
else:
|
||||
processor = process_text
|
||||
log.debug(
|
||||
f"Processing: {anything} with processor: {processor.__name__} for type {type(anything)}"
|
||||
)
|
||||
processed_data = processor(anything)
|
||||
|
||||
for ui_key, ui_value in processed_data.items():
|
||||
output["ui"][ui_key].extend(ui_value)
|
||||
if isinstance(ui_value, list):
|
||||
output["ui"][ui_key].extend(ui_value)
|
||||
else:
|
||||
output["ui"][ui_key].append(ui_value)
|
||||
# log.debug(
|
||||
# f"Processed input {k}, found {len(processed_data.get('b64_images', []))} images and {len(processed_data.get('text', []))} text items."
|
||||
# )
|
||||
|
||||
if output_to_console:
|
||||
from rich.console import Console
|
||||
|
||||
cons = Console()
|
||||
cons.print("OUTPUT:")
|
||||
cons.print(output)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
+9
-12
@@ -39,12 +39,7 @@ class MTB_LoadFaceEnhanceModel:
|
||||
cls._warned = True
|
||||
return []
|
||||
if not fr_models_path.exists():
|
||||
# log.warning(
|
||||
# f"No Face Restore checkpoints found at {fr_models_path} (if you've used mtb before these checkpoints were saved in upscale_models before)"
|
||||
# )
|
||||
# log.warning(
|
||||
# "For now we fallback to upscale_models but this will be removed in a future version"
|
||||
# )
|
||||
# - fallback to upscale_models
|
||||
if um_models_path.exists():
|
||||
return [
|
||||
x
|
||||
@@ -78,6 +73,7 @@ class MTB_LoadFaceEnhanceModel:
|
||||
RETURN_NAMES = ("model",)
|
||||
FUNCTION = "load_model"
|
||||
CATEGORY = "mtb/facetools"
|
||||
DEPRECATED = True
|
||||
|
||||
def load_model(self, model_name, upscale=2, bg_upsampler=None):
|
||||
from gfpgan import GFPGANer
|
||||
@@ -121,7 +117,7 @@ class BGUpscaleWrapper:
|
||||
tile = 128 + 64
|
||||
overlap = 8
|
||||
|
||||
imgt = np2tensor(img)
|
||||
imgt = pil2tensor(img)
|
||||
imgt = imgt.movedim(-1, -3).to(device)
|
||||
|
||||
steps = imgt.shape[0] * comfy.utils.get_tiled_scale_steps(
|
||||
@@ -151,9 +147,6 @@ class BGUpscaleWrapper:
|
||||
return (tensor2np(s)[0],)
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
class MTB_RestoreFace:
|
||||
"""Uses GFPGan to restore faces"""
|
||||
|
||||
@@ -163,6 +156,7 @@ class MTB_RestoreFace:
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
FUNCTION = "restore"
|
||||
CATEGORY = "mtb/facetools"
|
||||
DEPRECATED = True
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -231,8 +225,8 @@ class MTB_RestoreFace:
|
||||
)
|
||||
output.putalpha(alpha_resized)
|
||||
# imwrite(restored_img, save_restore_path)
|
||||
|
||||
return pil2tensor(output)
|
||||
return pil2tensor(output)
|
||||
log.warning("No restored image found")
|
||||
|
||||
def restore(
|
||||
self,
|
||||
@@ -257,6 +251,9 @@ class MTB_RestoreFace:
|
||||
for i in range(image.size(0))
|
||||
]
|
||||
|
||||
if len(out) == 0:
|
||||
raise ValueError("No faces restored")
|
||||
print(f"Restored {len(out)} faces")
|
||||
return (torch.cat(out, dim=0),)
|
||||
|
||||
def get_step_image_path(self, step, idx):
|
||||
|
||||
@@ -40,6 +40,7 @@ class MTB_LoadFaceAnalysisModel:
|
||||
RETURN_TYPES = ("FACE_ANALYSIS_MODEL",)
|
||||
FUNCTION = "load_model"
|
||||
CATEGORY = "mtb/facetools"
|
||||
DEPRECATED = True
|
||||
|
||||
def load_model(self, faceswap_model: str):
|
||||
if faceswap_model == "antelopev2":
|
||||
@@ -77,6 +78,7 @@ class MTB_LoadFaceSwapModel:
|
||||
RETURN_TYPES = ("FACESWAP_MODEL",)
|
||||
FUNCTION = "load_model"
|
||||
CATEGORY = "mtb/facetools"
|
||||
DEPRECATED = True
|
||||
|
||||
def load_model(self, faceswap_model: str):
|
||||
model_path = get_model_path("insightface", faceswap_model)
|
||||
@@ -126,6 +128,7 @@ class MTB_FaceSwap:
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
FUNCTION = "swap"
|
||||
CATEGORY = "mtb/facetools"
|
||||
DEPRECATED = True
|
||||
|
||||
def swap(
|
||||
self,
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
import torch
|
||||
|
||||
|
||||
class MTB_FilterZ:
|
||||
"""Filters an image based on a depth map"""
|
||||
class MTBFilterZ:
|
||||
"""Filters an image based on a depth map."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -66,4 +66,4 @@ class MTB_FilterZ:
|
||||
return (out_img,)
|
||||
|
||||
|
||||
__nodes__ = [MTB_FilterZ]
|
||||
__nodes__ = [MTBFilterZ]
|
||||
|
||||
+31
-3
@@ -1,7 +1,7 @@
|
||||
from PIL import Image
|
||||
|
||||
from ..log import log
|
||||
from ..utils import comfy_dir, font_path, pil2tensor
|
||||
from ..utils import comfy_dir, create_uv_map_tensor, font_path, pil2tensor
|
||||
|
||||
# class MtbExamples:
|
||||
# """MTB Example Images"""
|
||||
@@ -193,11 +193,11 @@ by default it fallsback to a default font.
|
||||
),
|
||||
"color": (
|
||||
"COLOR",
|
||||
{"default": "black"},
|
||||
{"default": "#000000"},
|
||||
),
|
||||
"background": (
|
||||
"COLOR",
|
||||
{"default": "white"},
|
||||
{"default": "#FFFFFF"},
|
||||
),
|
||||
"h_align": (("left", "center", "right"), {"default": "left"}),
|
||||
"v_align": (("top", "center", "bottom"), {"default": "top"}),
|
||||
@@ -292,8 +292,36 @@ by default it fallsback to a default font.
|
||||
return (pil2tensor(img),)
|
||||
|
||||
|
||||
class MTB_UvMap:
|
||||
"""Generates a UV Map tensor given a widht and height"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"width": (
|
||||
"INT",
|
||||
{"default": 512, "min": 1, "max": 8096, "step": 1},
|
||||
),
|
||||
"height": (
|
||||
"INT",
|
||||
{"default": 512, "min": 1, "max": 8096, "step": 1},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("UV_MAP",)
|
||||
RETURN_NAMES = ("uv_map",)
|
||||
FUNCTION = "create_uv_map"
|
||||
CATEGORY = "mtb/generate"
|
||||
|
||||
def create_uv_map(self, width, height):
|
||||
return (create_uv_map_tensor(width, height),)
|
||||
|
||||
|
||||
__nodes__ = [
|
||||
MTB_UnsplashImage,
|
||||
MTB_TextToImage,
|
||||
MTB_UvMap,
|
||||
# MtbExamples,
|
||||
]
|
||||
|
||||
@@ -0,0 +1,576 @@
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
import open3d as o3d
|
||||
|
||||
from ..utils import (
|
||||
create_box,
|
||||
get_transformation_matrix,
|
||||
log,
|
||||
spread_geo,
|
||||
tensor2b64,
|
||||
)
|
||||
|
||||
# create_grid,
|
||||
# create_sphere,
|
||||
# create_torus,
|
||||
# mesh_to_json,
|
||||
# json_to_mesh
|
||||
# rotate_mesh,
|
||||
# euler_to_rotation_matrix,
|
||||
|
||||
|
||||
# class GeoPrimitive:
|
||||
# """Primitive 3D geometry"""
|
||||
|
||||
# @classmethod
|
||||
# def INPUT_TYPES(cls):
|
||||
# return {
|
||||
# "required": {
|
||||
# "kind": (["Box", "Sphere", "Cylinder", "Torus"], {"default": "Box"})
|
||||
# }
|
||||
# }
|
||||
|
||||
# RETURN_TYPES = ("UV_MAP",)
|
||||
# RETURN_NAMES = ("uv_map",)
|
||||
# FUNCTION = "distort_uvs"
|
||||
# CATEGORY = "mtb/uv"
|
||||
|
||||
|
||||
def default_material(color=None):
|
||||
return {
|
||||
"color": color or "#00ff00",
|
||||
"roughness": 1.0,
|
||||
"metalness": 0.0,
|
||||
"emissive": "#000000",
|
||||
"displacementScale": 1.0,
|
||||
"displacementMap": None,
|
||||
}
|
||||
|
||||
|
||||
class MTB_Camera:
|
||||
"""Make a Camera."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
base = default_material()
|
||||
return {
|
||||
"required": {
|
||||
"color": ("COLOR", {"default": base["color"]}),
|
||||
"roughness": (
|
||||
"FLOAT",
|
||||
{
|
||||
"default": base["roughness"],
|
||||
"min": 0.005,
|
||||
"max": 4.0,
|
||||
"step": 0.01,
|
||||
},
|
||||
),
|
||||
"flatShading": ("BOOLEAN",),
|
||||
"metalness": (
|
||||
"FLOAT",
|
||||
{
|
||||
"default": base["metalness"],
|
||||
"min": 0.0,
|
||||
"max": 1.0,
|
||||
"step": 0.01,
|
||||
},
|
||||
),
|
||||
"emissive": ("COLOR", {"default": base["emissive"]}),
|
||||
"displacementScale": (
|
||||
"FLOAT",
|
||||
{"default": 1.0, "min": -10.0, "max": 10.0},
|
||||
),
|
||||
},
|
||||
"optional": {"displacementMap": ("IMAGE",)},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("CAMERA",)
|
||||
RETURN_NAMES = ("camera",)
|
||||
FUNCTION = "make_camera"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def make_camera(self, **kwargs):
|
||||
return (kwargs,)
|
||||
|
||||
|
||||
class MTB_GeometryDraw:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"geometry": ("GEOMETRY",),
|
||||
},
|
||||
"optional": {
|
||||
"camera": ("CAMERA",),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
RETURN_NAMES = ("rendered_image",)
|
||||
FUNCTION = "render"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def render(self, geometry, camera):
|
||||
mesh, material = spread_geo(geometry)
|
||||
o3d.visualization.draw_geometries([mesh], **camera)
|
||||
|
||||
|
||||
# class MTB_RGBD_Image:
|
||||
# @classmethod
|
||||
# def INPUT_TYPES(cls):
|
||||
# return {
|
||||
# "required": {
|
||||
# "image": ("IMAGE",),
|
||||
# "depth": ("IMAGE",),
|
||||
# }
|
||||
# }
|
||||
|
||||
# RETURN_TYPES = ("RGBD_IMAGE",)
|
||||
# RETURN_NAMES = ("rgbd",)
|
||||
# FUNCTION = "make_rgbd"
|
||||
# CATEGORY = "mtb/3D"
|
||||
|
||||
# def make_rgbd(self, image, depth):
|
||||
# color_raw = o3d.io.read_image("../../test_data/RGBD/color/00000.jpg")
|
||||
# depth_raw = o3d.io.read_image("../../test_data/RGBD/depth/00000.png")
|
||||
# rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
|
||||
# color_raw, depth_raw
|
||||
# )
|
||||
# print(rgbd_image)
|
||||
|
||||
|
||||
class MTB_GeometryMaterial:
|
||||
"""Make a std material."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
base = default_material()
|
||||
return {
|
||||
"required": {
|
||||
"color": ("COLOR", {"default": base["color"]}),
|
||||
"roughness": (
|
||||
"FLOAT",
|
||||
{
|
||||
"default": base["roughness"],
|
||||
"min": 0.005,
|
||||
"max": 4.0,
|
||||
"step": 0.01,
|
||||
},
|
||||
),
|
||||
"flatShading": ("BOOLEAN",),
|
||||
"metalness": (
|
||||
"FLOAT",
|
||||
{
|
||||
"default": base["metalness"],
|
||||
"min": 0.0,
|
||||
"max": 1.0,
|
||||
"step": 0.01,
|
||||
},
|
||||
),
|
||||
"emissive": ("COLOR", {"default": base["emissive"]}),
|
||||
"displacementScale": (
|
||||
"FLOAT",
|
||||
{"default": 1.0, "min": -10.0, "max": 10.0},
|
||||
),
|
||||
},
|
||||
"optional": {"displacementMap": ("IMAGE",)},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("GEO_MATERIAL",)
|
||||
RETURN_NAMES = ("material",)
|
||||
FUNCTION = "make_material"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def make_material(
|
||||
self, **kwargs
|
||||
): # color, roughness, metalness, emissive, displacementScalen displacementMap=None):
|
||||
# TODO: convert image to b64 and remove the key/add the B64 one
|
||||
# TODO: we can just use the "wireframe" property instead of my current solution
|
||||
if kwargs.get("displacementMap") is not None:
|
||||
tens = kwargs.pop("displacementMap")
|
||||
# TODO: alert about batch size > 1 ?
|
||||
b64images = tensor2b64(tens)[0]
|
||||
kwargs["displacementB64"] = b64images
|
||||
|
||||
return (kwargs,)
|
||||
|
||||
|
||||
class MTB_GeometryApplyMaterial:
|
||||
"""Apply a Material to a geometry."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"geometry": ("GEOMETRY",),
|
||||
"color": ("COLOR", {"default": "#000000"}),
|
||||
},
|
||||
"optional": {"material": ("GEO_MATERIAL",)},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("GEOMETRY",)
|
||||
RETURN_NAMES = ("geometry",)
|
||||
FUNCTION = "apply"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def apply(
|
||||
self,
|
||||
geometry,
|
||||
color,
|
||||
material=None,
|
||||
):
|
||||
if material is None:
|
||||
material = default_material(color)
|
||||
#
|
||||
geometry["material"] = material
|
||||
|
||||
return (geometry,)
|
||||
|
||||
|
||||
class MTB_GeometryTransform:
|
||||
"""Transforms the input geometry."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"mesh": ("GEOMETRY",),
|
||||
"position_x": (
|
||||
"FLOAT",
|
||||
{"default": 0.0, "step": 0.1, "min": -10000, "max": 10000},
|
||||
),
|
||||
"position_y": (
|
||||
"FLOAT",
|
||||
{"default": 0.0, "step": 0.1, "min": -10000, "max": 10000},
|
||||
),
|
||||
"position_z": (
|
||||
"FLOAT",
|
||||
{"default": 0.0, "step": 0.1, "min": -10000, "max": 10000},
|
||||
),
|
||||
"rotation_x": (
|
||||
"FLOAT",
|
||||
{"default": 0.0, "step": 1, "min": -10000, "max": 10000},
|
||||
),
|
||||
"rotation_y": (
|
||||
"FLOAT",
|
||||
{"default": 0.0, "step": 1, "min": -10000, "max": 10000},
|
||||
),
|
||||
"rotation_z": (
|
||||
"FLOAT",
|
||||
{"default": 0.0, "step": 1, "min": -10000, "max": 10000},
|
||||
),
|
||||
"scale_x": ("FLOAT", {"default": 1.0, "step": 0.1}),
|
||||
"scale_y": ("FLOAT", {"default": 1.0, "step": 0.1}),
|
||||
"scale_z": ("FLOAT", {"default": 1.0, "step": 0.1}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("GEOMETRY",)
|
||||
RETURN_NAMES = ("geometry",)
|
||||
FUNCTION = "transform_geometry"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def transform_geometry(
|
||||
self,
|
||||
mesh: o3d.geometry.TriangleMesh,
|
||||
position_x=0.0,
|
||||
position_y=0.0,
|
||||
position_z=0.0,
|
||||
rotation_x=0,
|
||||
rotation_y=0,
|
||||
rotation_z=0,
|
||||
scale_x=1,
|
||||
scale_y=1,
|
||||
scale_z=1,
|
||||
):
|
||||
# mesh = o3d.geometry.TriangleMesh.create_box(
|
||||
# width,
|
||||
# height,
|
||||
# depth,
|
||||
|
||||
# )
|
||||
# mesh.compute_vertex_normals()
|
||||
|
||||
position = np.array([position_x, position_y, position_z])
|
||||
rotation = (rotation_x, rotation_y, rotation_z)
|
||||
scale = np.array([scale_x, scale_y, scale_z])
|
||||
|
||||
transformation_matrix = get_transformation_matrix(
|
||||
position, rotation, scale
|
||||
)
|
||||
mesh, material = spread_geo(mesh, cp=True)
|
||||
|
||||
return (
|
||||
{
|
||||
"mesh": mesh.transform(transformation_matrix),
|
||||
"material": material,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
class MTB_GeometrySphere:
|
||||
"""Makes a Sphere 3D geometry.."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"create_uv_map": ("BOOLEAN", {"default": True}),
|
||||
"radius": ("FLOAT", {"default": 1.0, "step": 0.1}),
|
||||
"resolution": ("INT", {"default": 20, "min": 1}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("GEOMETRY",)
|
||||
RETURN_NAMES = ("geometry",)
|
||||
FUNCTION = "make_sphere"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def make_sphere(self, create_uv_map, radius, resolution):
|
||||
mesh = o3d.geometry.TriangleMesh.create_sphere(
|
||||
radius,
|
||||
resolution,
|
||||
create_uv_map,
|
||||
)
|
||||
mesh.compute_vertex_normals()
|
||||
|
||||
return ({"mesh": mesh},)
|
||||
|
||||
|
||||
class MTB_GeometryTest:
|
||||
"""Fetches an Open3D data geometry.."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"name": (
|
||||
[
|
||||
"ArmadilloMesh",
|
||||
"AvocadoModel",
|
||||
"BunnyMesh",
|
||||
"CrateModel",
|
||||
"DamagedHelmetModel",
|
||||
"FlightHelmetModel",
|
||||
"KnotMesh",
|
||||
"MonkeyModel",
|
||||
"SwordModel",
|
||||
],
|
||||
{
|
||||
"default": "KnotMesh",
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("GEOMETRY",)
|
||||
RETURN_NAMES = ("geometry",)
|
||||
FUNCTION = "fetch_data"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def fetch_data(self, name):
|
||||
model = getattr(o3d.data, name)()
|
||||
mesh = o3d.io.read_triangle_mesh(model.path)
|
||||
mesh.compute_vertex_normals()
|
||||
return ({"mesh": mesh},)
|
||||
|
||||
|
||||
class MTB_GeometryBox:
|
||||
"""Makes a Box 3D geometry."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
# "create_uv_map": ("BOOLEAN", {"default": True}),
|
||||
"uniform_scale": ("FLOAT", {"default": 1.0, "step": 0.1}),
|
||||
"width": ("FLOAT", {"default": 1.0, "step": 0.05}),
|
||||
"height": ("FLOAT", {"default": 1.0, "step": 0.05}),
|
||||
"depth": ("FLOAT", {"default": 1.0, "step": 0.05}),
|
||||
"divisions_x": ("INT", {"default": 1}),
|
||||
"divisions_y": ("INT", {"default": 1}),
|
||||
"divisions_z": ("INT", {"default": 1}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("GEOMETRY",)
|
||||
RETURN_NAMES = ("geometry",)
|
||||
FUNCTION = "make_box"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def make_box(
|
||||
self,
|
||||
uniform_scale,
|
||||
width,
|
||||
height,
|
||||
depth,
|
||||
divisions_x,
|
||||
divisions_y,
|
||||
divisions_z,
|
||||
):
|
||||
width, height, depth = (width, height, depth) * uniform_scale
|
||||
|
||||
# mesh = o3d.geometry.TriangleMesh.create_box(
|
||||
# width,
|
||||
# height,
|
||||
# depth,
|
||||
|
||||
# )
|
||||
# mesh.compute_vertex_normals()
|
||||
|
||||
mesh = create_box(
|
||||
(width, height, depth), (divisions_x, divisions_y, divisions_z)
|
||||
)
|
||||
|
||||
return ({"mesh": mesh},)
|
||||
|
||||
|
||||
class MTB_GeometryLoad:
|
||||
"""Load a 3D geometry."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {"required": {"path": ("STRING", {"default": ""})}}
|
||||
|
||||
RETURN_TYPES = ("GEOMETRY",)
|
||||
RETURN_NAMES = ("geometry",)
|
||||
FUNCTION = "load_geo"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def load_geo(self, path):
|
||||
if not os.path.exists(path):
|
||||
raise ValueError(f"Path {path} does not exist")
|
||||
|
||||
mesh = o3d.io.read_triangle_mesh(path)
|
||||
|
||||
if len(mesh.vertices) == 0:
|
||||
mesh = o3d.io.read_triangle_model(path)
|
||||
mesh_count = len(mesh.meshes)
|
||||
if mesh_count == 0:
|
||||
raise ValueError("Couldn't parse input file")
|
||||
|
||||
if mesh_count > 1:
|
||||
log.warn(
|
||||
f"Found {mesh_count} meshes, only the first will be used..."
|
||||
)
|
||||
|
||||
mesh = mesh.meshes[0].mesh
|
||||
|
||||
mesh.compute_vertex_normals()
|
||||
|
||||
return {
|
||||
"result": ({"mesh": mesh},),
|
||||
}
|
||||
|
||||
|
||||
class MTB_GeometryInfo:
|
||||
"""Retrieve information about a 3D geometry."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {"required": {"geometry": ("GEOMETRY", {})}}
|
||||
|
||||
RETURN_TYPES = ("INT", "INT", "MATERIAL")
|
||||
RETURN_NAMES = ("num_vertices", "num_triangles", "material")
|
||||
FUNCTION = "get_info"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def get_info(self, geometry):
|
||||
mesh, material = spread_geo(geometry)
|
||||
log.debug(mesh)
|
||||
return (len(mesh.vertices), len(mesh.triangles), material)
|
||||
|
||||
|
||||
class MTB_GeometryDecimater:
|
||||
"""Optimized the geometry to match the target number of triangles."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"mesh": ("GEOMETRY", {}),
|
||||
"target": ("INT", {"default": 1500, "min": 3, "max": 500000}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("GEOMETRY",)
|
||||
RETURN_NAMES = ("geometry",)
|
||||
FUNCTION = "decimate"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def decimate(self, mesh, target):
|
||||
mesh = mesh.simplify_quadric_decimation(
|
||||
target_number_of_triangles=target
|
||||
)
|
||||
mesh.compute_vertex_normals()
|
||||
|
||||
return ({"mesh": mesh},)
|
||||
|
||||
|
||||
class MTB_GeometrySceneSetup:
|
||||
"""Scene setup for the renderer."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"geometry": ("GEOMETRY",),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("SCENE",)
|
||||
RETURN_NAMES = ("scene",)
|
||||
FUNCTION = "setup"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def setup(self, mesh, target):
|
||||
return ({"geometry": {"mesh": mesh}, "camera": cam},)
|
||||
|
||||
|
||||
class MTB_GeometryRender:
|
||||
"""Renders a Geometry to an image."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"geometry": ("SCENE", {}),
|
||||
"width": ("INT", {"default": 512, "min": 1}),
|
||||
"height": ("INT", {"default": 512, "min": 1}),
|
||||
"background": ("COLOR", {"default": [0.0, 0.0, 0.0]}),
|
||||
"camera": ("CAMERA",),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
RETURN_NAMES = ("image",)
|
||||
FUNCTION = "render"
|
||||
CATEGORY = "mtb/3D"
|
||||
|
||||
def render(self, geometry, width, height, background, camera):
|
||||
# create a renderer
|
||||
renderer = o3d.visualization.rendering.OffscreenRenderer(width, height)
|
||||
renderer.set_camera(camera)
|
||||
renderer.clear(background)
|
||||
renderer.add_geometry(geometry)
|
||||
renderer.render()
|
||||
image = renderer.get_image()
|
||||
return (image,)
|
||||
|
||||
|
||||
__nodes__ = [
|
||||
MTB_Camera,
|
||||
MTB_GeometryApplyMaterial,
|
||||
MTB_GeometryBox,
|
||||
MTB_GeometryDecimater,
|
||||
MTB_GeometryDraw,
|
||||
MTB_GeometryInfo,
|
||||
MTB_GeometryLoad,
|
||||
MTB_GeometryMaterial,
|
||||
MTB_GeometryRender,
|
||||
MTB_GeometrySceneSetup,
|
||||
MTB_GeometrySphere,
|
||||
MTB_GeometryTest,
|
||||
MTB_GeometryTransform,
|
||||
]
|
||||
+40
-23
@@ -22,8 +22,9 @@ from ..utils import (
|
||||
|
||||
|
||||
def get_image(filename, subfolder, folder_type):
|
||||
"""Use the comfyUI "/view" endpoint to get an image from the server."""
|
||||
log.debug(
|
||||
f"Getting image {filename} from foldertype {folder_type} {f'in subfolder: {subfolder}' if subfolder else ''}"
|
||||
f"Getting image {filename} from foldertype {folder_type} {f'in subfolder: {subfolder}' if subfolder else ''}" # noqa: E501
|
||||
)
|
||||
data = {"filename": filename, "subfolder": subfolder, "type": folder_type}
|
||||
base_url, port = get_server_info()
|
||||
@@ -31,7 +32,8 @@ def get_image(filename, subfolder, folder_type):
|
||||
url_values = urllib.parse.urlencode(data)
|
||||
url = f"http://{base_url}:{port}/view?{url_values}"
|
||||
log.debug(f"Fetching image from {url}")
|
||||
with urllib.request.urlopen(url) as response:
|
||||
|
||||
with urllib.request.urlopen(url) as response: # noqa: S310
|
||||
return io.BytesIO(response.read())
|
||||
|
||||
|
||||
@@ -369,7 +371,7 @@ class MTB_GetBatchFromHistory:
|
||||
history_url = f"http://{base_url}:{port}/history"
|
||||
log.debug(f"Fetching history from {history_url}")
|
||||
output = torch.zeros(0)
|
||||
with urllib.request.urlopen(history_url) as response:
|
||||
with urllib.request.urlopen(history_url) as response: # noqa: S310
|
||||
output = self.load_batch_frames(response, offset, count, frames)
|
||||
|
||||
if output.size(0) == 0:
|
||||
@@ -417,38 +419,44 @@ class MTB_AnyToString:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {"input": ("*",)},
|
||||
"required": {"input_value": ("*",)},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
FUNCTION = "do_str"
|
||||
CATEGORY = "mtb/converters"
|
||||
|
||||
def do_str(self, input):
|
||||
if isinstance(input, str):
|
||||
return (input,)
|
||||
elif isinstance(input, torch.Tensor):
|
||||
return (f"Tensor of shape {input.shape} and dtype {input.dtype}",)
|
||||
elif isinstance(input, Image.Image):
|
||||
return (f"PIL Image of size {input.size} and mode {input.mode}",)
|
||||
elif isinstance(input, np.ndarray):
|
||||
def do_str(self, input_value):
|
||||
if isinstance(input_value, str):
|
||||
return (input_value,)
|
||||
elif isinstance(input_value, torch.Tensor):
|
||||
return (
|
||||
f"Numpy array of shape {input.shape} and dtype {input.dtype}",
|
||||
f"Tensor of shape {input_value.shape} and dtype {input_value.dtype}",
|
||||
)
|
||||
elif isinstance(input_value, Image.Image):
|
||||
return (
|
||||
f"PIL Image of size {input_value.size} and mode {input_value.mode}",
|
||||
)
|
||||
elif isinstance(input_value, np.ndarray):
|
||||
return (
|
||||
f"Numpy array of shape {input_value.shape} and dtype {input_value.dtype}",
|
||||
)
|
||||
|
||||
elif isinstance(input, dict):
|
||||
elif isinstance(input_value, dict):
|
||||
return (
|
||||
f"Dictionary of {len(input)} items, with keys {input.keys()}",
|
||||
f"Dictionary of {len(input_value)} items, with keys {input_value.keys()}",
|
||||
)
|
||||
|
||||
else:
|
||||
log.debug(f"Falling back to string conversion of {input}")
|
||||
return (str(input),)
|
||||
log.debug(f"Falling back to string conversion of {input_value}")
|
||||
return (str(input_value),)
|
||||
|
||||
|
||||
class MTB_StringReplace:
|
||||
"""Basic string replacement."""
|
||||
|
||||
"""Basic string replacement."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
@@ -476,7 +484,7 @@ class MTB_StringReplace:
|
||||
|
||||
|
||||
class MTB_MathExpression:
|
||||
"""Node to evaluate a simple math expression string"""
|
||||
"""Node to evaluate a simple math expression string."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -513,6 +521,14 @@ class MTB_MathExpression:
|
||||
raise ValueError(
|
||||
f"Math expression only support literal_eval now: {e}"
|
||||
)
|
||||
except ValueError:
|
||||
try:
|
||||
expression = expression.replace("^", "**")
|
||||
result = eval(expression) # noqa: S307
|
||||
except Exception as e:
|
||||
raise ValueError(
|
||||
f"Error evaluating expression '{expression}': {e}"
|
||||
) from e
|
||||
|
||||
return (result, int(result))
|
||||
|
||||
@@ -556,13 +572,14 @@ class MTB_FitNumber:
|
||||
|
||||
def set_range(
|
||||
self,
|
||||
*,
|
||||
value: float,
|
||||
clamp: bool,
|
||||
source_min: float,
|
||||
source_max: float,
|
||||
target_min: float,
|
||||
target_max: float,
|
||||
easing: str,
|
||||
source_min=0.0,
|
||||
source_max=1.0,
|
||||
target_min=0.0,
|
||||
target_max=1.0,
|
||||
easing="Linear",
|
||||
):
|
||||
if source_min == source_max:
|
||||
normalized_value = 0
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
import comfy
|
||||
import comfy.model_management as model_management
|
||||
@@ -15,10 +14,13 @@ from ..utils import get_model_path
|
||||
|
||||
|
||||
class MTB_LoadFilmModel:
|
||||
"""Loads a FILM model"""
|
||||
"""Loads a FILM model.
|
||||
|
||||
[DEPRECATED] Use ComfyUI-FrameInterpolation instead
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def get_models() -> List[Path]:
|
||||
def get_models() -> list[Path]:
|
||||
models_paths = get_model_path("FILM").iterdir()
|
||||
|
||||
return [x for x in models_paths if x.suffix in [".onnx", ".pth"]]
|
||||
@@ -37,6 +39,7 @@ class MTB_LoadFilmModel:
|
||||
RETURN_TYPES = ("FILM_MODEL",)
|
||||
FUNCTION = "load_model"
|
||||
CATEGORY = "mtb/frame iterpolation"
|
||||
DEPRECATED = True
|
||||
|
||||
def load_model(self, film_model: str):
|
||||
model_path = get_model_path("FILM", film_model)
|
||||
@@ -56,7 +59,10 @@ class MTB_LoadFilmModel:
|
||||
|
||||
|
||||
class MTB_FilmInterpolation:
|
||||
"""Google Research FILM frame interpolation for large motion"""
|
||||
"""Google Research FILM frame interpolation for large motion.
|
||||
|
||||
[DEPRECATED] Use ComfyUI-FrameInterpolation instead
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -71,6 +77,7 @@ class MTB_FilmInterpolation:
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
FUNCTION = "do_interpolation"
|
||||
CATEGORY = "mtb/frame iterpolation"
|
||||
DEPRECATED = True
|
||||
|
||||
def do_interpolation(
|
||||
self,
|
||||
@@ -101,7 +108,9 @@ class MTB_FilmInterpolation:
|
||||
pbar = comfy.utils.ProgressBar(num_frames)
|
||||
|
||||
for frame in util.interpolate_recursively_from_memory(
|
||||
in_frames, interpolate, film_model
|
||||
in_frames, # type: ignore
|
||||
interpolate,
|
||||
film_model,
|
||||
):
|
||||
out_tensors.append(
|
||||
torch.from_numpy(frame)
|
||||
|
||||
+55
-19
@@ -2,9 +2,9 @@ import json
|
||||
import subprocess
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
from typing import List, Optional
|
||||
|
||||
import comfy.model_management as model_management
|
||||
import comfy.utils
|
||||
import folder_paths
|
||||
import numpy as np
|
||||
import torch
|
||||
@@ -41,6 +41,7 @@ class MTB_ReadPlaylist:
|
||||
RETURN_TYPES = ("PLAYLIST",)
|
||||
FUNCTION = "read_playlist"
|
||||
CATEGORY = "mtb/IO"
|
||||
EXPERIMENTAL = True
|
||||
|
||||
def read_playlist(
|
||||
self,
|
||||
@@ -83,6 +84,7 @@ class MTB_AddToPlaylist:
|
||||
OUTPUT_NODE = True
|
||||
FUNCTION = "add_to_playlist"
|
||||
CATEGORY = "mtb/IO"
|
||||
EXPERIMENTAL = True
|
||||
|
||||
def add_to_playlist(
|
||||
self,
|
||||
@@ -117,7 +119,10 @@ class MTB_AddToPlaylist:
|
||||
|
||||
|
||||
class MTB_ExportWithFfmpeg:
|
||||
"""Export with FFmpeg (Experimental)"""
|
||||
"""Export with FFmpeg (Experimental).
|
||||
|
||||
[DEPRACATED] Use VHS nodes instead
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -143,6 +148,7 @@ class MTB_ExportWithFfmpeg:
|
||||
RETURN_TYPES = ("VIDEO",)
|
||||
OUTPUT_NODE = True
|
||||
FUNCTION = "export_prores"
|
||||
DEPRECATED = True
|
||||
CATEGORY = "mtb/IO"
|
||||
|
||||
def export_prores(
|
||||
@@ -151,10 +157,9 @@ class MTB_ExportWithFfmpeg:
|
||||
prefix: str,
|
||||
format: str,
|
||||
codec: str,
|
||||
images: Optional[torch.Tensor] = None,
|
||||
playlist: Optional[List[str]] = None,
|
||||
images: torch.Tensor | None = None,
|
||||
playlist: list[str] | None = None,
|
||||
):
|
||||
pix_fmt = "rgb48le" if codec == "prores_ks" else "yuv420p"
|
||||
file_ext = format
|
||||
file_id = f"{prefix}_{uuid.uuid4()}.{file_ext}"
|
||||
|
||||
@@ -208,9 +213,11 @@ class MTB_ExportWithFfmpeg:
|
||||
frames = tensor2np(images)
|
||||
log.debug(f"Frames type {type(frames[0])}")
|
||||
log.debug(f"Exporting {len(frames)} frames")
|
||||
height, width, channels = frames[0].shape
|
||||
has_alpha = channels == 4
|
||||
out_path = (output_dir / file_id).as_posix()
|
||||
|
||||
if codec == "gif":
|
||||
out_path = (output_dir / file_id).as_posix()
|
||||
command = [
|
||||
"ffmpeg",
|
||||
"-f",
|
||||
@@ -233,12 +240,28 @@ class MTB_ExportWithFfmpeg:
|
||||
|
||||
process.stdin.close()
|
||||
process.wait()
|
||||
return (out_path,)
|
||||
else:
|
||||
frames = [frame.astype(np.uint16) * 257 for frame in frames]
|
||||
|
||||
height, width, _ = frames[0].shape
|
||||
|
||||
out_path = (output_dir / file_id).as_posix()
|
||||
if has_alpha:
|
||||
if codec in ["prores_ks", "libx264", "libx265"]:
|
||||
pix_fmt = (
|
||||
"yuva444p" if codec == "prores_ks" else "yuva420p"
|
||||
)
|
||||
frames = [
|
||||
frame.astype(np.uint16) * 257 for frame in frames
|
||||
]
|
||||
else:
|
||||
log.warning(
|
||||
f"Alpha channel not supported for codec {codec}. Alpha will be ignored."
|
||||
)
|
||||
frames = [
|
||||
frame[:, :, :3].astype(np.uint16) * 257
|
||||
for frame in frames
|
||||
]
|
||||
pix_fmt = "rgb48le" if codec == "prores_ks" else "yuv420p"
|
||||
else:
|
||||
pix_fmt = "rgb48le" if codec == "prores_ks" else "yuv420p"
|
||||
frames = [frame.astype(np.uint16) * 257 for frame in frames]
|
||||
|
||||
# Prepare the FFmpeg command
|
||||
command = [
|
||||
@@ -258,17 +281,26 @@ class MTB_ExportWithFfmpeg:
|
||||
"-",
|
||||
"-c:v",
|
||||
codec,
|
||||
"-r",
|
||||
str(fps),
|
||||
"-y",
|
||||
out_path,
|
||||
]
|
||||
if codec == "prores_ks":
|
||||
command.extend(["-profile:v", "4444"])
|
||||
|
||||
command.extend(
|
||||
[
|
||||
"-r",
|
||||
str(fps),
|
||||
"-y",
|
||||
out_path,
|
||||
]
|
||||
)
|
||||
|
||||
process = subprocess.Popen(command, stdin=subprocess.PIPE)
|
||||
|
||||
pbar = comfy.utils.ProgressBar(len(frames))
|
||||
|
||||
for frame in frames:
|
||||
model_management.throw_exception_if_processing_interrupted()
|
||||
process.stdin.write(frame.tobytes())
|
||||
pbar.update(1)
|
||||
|
||||
process.stdin.close()
|
||||
process.wait()
|
||||
@@ -280,9 +312,9 @@ def prepare_animated_batch(
|
||||
batch: torch.Tensor,
|
||||
pingpong=False,
|
||||
resize_by=1.0,
|
||||
resample_filter: Optional[Image.Resampling] = None,
|
||||
resample_filter: Image.Resampling | None = None,
|
||||
image_type=np.uint8,
|
||||
) -> List[Image.Image]:
|
||||
) -> list[Image.Image]:
|
||||
images = tensor2np(batch)
|
||||
images = [frame.astype(image_type) for frame in images]
|
||||
|
||||
@@ -308,7 +340,10 @@ def prepare_animated_batch(
|
||||
|
||||
# todo: deprecate for apng
|
||||
class MTB_SaveGif:
|
||||
"""Save the images from the batch as a GIF"""
|
||||
"""Save the images from the batch as a GIF.
|
||||
|
||||
[DEPRACATED] Use VHS nodes instead
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -328,6 +363,7 @@ class MTB_SaveGif:
|
||||
OUTPUT_NODE = True
|
||||
CATEGORY = "mtb/IO"
|
||||
FUNCTION = "save_gif"
|
||||
DEPRECATED = True
|
||||
|
||||
def save_gif(
|
||||
self,
|
||||
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
from PIL import Image
|
||||
|
||||
from ..log import log
|
||||
|
||||
|
||||
class ImageH264Compression:
|
||||
"""Encodes the input with h264 compression using a configurable CRF."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"image": (
|
||||
"IMAGE",
|
||||
{
|
||||
"tooltip": "The input image tensor to be compressed and decompressed."
|
||||
},
|
||||
),
|
||||
"crf": (
|
||||
"INT",
|
||||
{
|
||||
"default": 23,
|
||||
"min": 0,
|
||||
"max": 51,
|
||||
"step": 1,
|
||||
"tooltip": "Constant Rate Factor for h264 encoding (lower values mean higher quality).",
|
||||
},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
FUNCTION = "compress_and_decompress"
|
||||
|
||||
CATEGORY = "image"
|
||||
DESCRIPTION = """
|
||||
**Encodes the input with h264 compression using a configurable CRF**.
|
||||
|
||||
> [!NOTE]
|
||||
> This was recommended by the creators of LTX over banodoco's discord.
|
||||
|
||||
*Orginal code from [mix](https://github.com/XmYx)*"""
|
||||
|
||||
def _compress_decompress_ffmpeg(self, img_array, crf):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
input_path = os.path.join(temp_dir, "input.png")
|
||||
output_path = os.path.join(temp_dir, "output.mp4")
|
||||
decoded_path = os.path.join(temp_dir, "decoded.png")
|
||||
|
||||
Image.fromarray(img_array).save(input_path)
|
||||
|
||||
encode_command = [
|
||||
"ffmpeg",
|
||||
"-y",
|
||||
"-i",
|
||||
input_path,
|
||||
"-c:v",
|
||||
"libx264",
|
||||
"-crf",
|
||||
str(crf),
|
||||
"-pix_fmt",
|
||||
"yuv420p",
|
||||
"-frames:v",
|
||||
"1",
|
||||
output_path,
|
||||
]
|
||||
subprocess.run(encode_command, capture_output=True)
|
||||
|
||||
decode_command = [
|
||||
"ffmpeg",
|
||||
"-y",
|
||||
"-i",
|
||||
output_path,
|
||||
"-frames:v",
|
||||
"1",
|
||||
decoded_path,
|
||||
]
|
||||
subprocess.run(decode_command, capture_output=True)
|
||||
|
||||
decoded_img = np.array(Image.open(decoded_path))
|
||||
return decoded_img
|
||||
|
||||
def compress_and_decompress(self, image, crf):
|
||||
import io
|
||||
|
||||
output_images = []
|
||||
|
||||
try:
|
||||
import av
|
||||
|
||||
for img_tensor in image:
|
||||
img_array = img_tensor.cpu().numpy()
|
||||
img_array = (img_array * 255).astype(np.uint8)
|
||||
img_array = img_array.copy(
|
||||
order="C"
|
||||
) # Ensure contiguous array
|
||||
|
||||
output = io.BytesIO()
|
||||
|
||||
# Encode the image to h264 with the given CRF
|
||||
container = av.open(output, mode="w", format="mp4")
|
||||
stream = container.add_stream("h264", rate=1)
|
||||
stream.width = img_array.shape[1]
|
||||
stream.height = img_array.shape[0]
|
||||
stream.pix_fmt = "yuv420p"
|
||||
stream.options = {"crf": str(crf)}
|
||||
|
||||
frame = av.VideoFrame.from_ndarray(img_array, format="rgb24")
|
||||
for packet in stream.encode(frame):
|
||||
container.mux(packet)
|
||||
for packet in stream.encode():
|
||||
container.mux(packet)
|
||||
container.close()
|
||||
|
||||
# Decode the video back to an image
|
||||
output.seek(0)
|
||||
container = av.open(output, mode="r", format="mp4")
|
||||
decoded_frames = []
|
||||
for frame in container.decode(video=0):
|
||||
img_decoded = frame.to_ndarray(format="rgb24")
|
||||
decoded_frames.append(img_decoded)
|
||||
container.close()
|
||||
|
||||
if len(decoded_frames) > 0:
|
||||
img_decoded = decoded_frames[0]
|
||||
img_decoded = torch.from_numpy(
|
||||
img_decoded.astype(np.float32) / 255.0
|
||||
)
|
||||
output_images.append(img_decoded)
|
||||
else:
|
||||
# If decoding failed, use the original image
|
||||
output_images.append(img_tensor)
|
||||
except ImportError:
|
||||
log.warning(
|
||||
"PyAv is not installed... Falling back to the ffmpeg cli"
|
||||
)
|
||||
for img_tensor in image:
|
||||
img_array = (img_tensor.cpu().numpy() * 255).astype(np.uint8)
|
||||
decoded_img = self._compress_decompress_ffmpeg(img_array, crf)
|
||||
img_decoded = torch.from_numpy(
|
||||
decoded_img.astype(np.float32) / 255.0
|
||||
)
|
||||
output_images.append(img_decoded)
|
||||
|
||||
output_images = torch.stack(output_images).to(image.device)
|
||||
return (output_images,)
|
||||
|
||||
# fmt: off
|
||||
__nodes__ = [
|
||||
ImageH264Compression
|
||||
]
|
||||
+2
-1
@@ -1,6 +1,5 @@
|
||||
import comfy.utils
|
||||
from PIL import Image
|
||||
from rembg import remove
|
||||
|
||||
from ..utils import pil2tensor, tensor2pil
|
||||
|
||||
@@ -64,6 +63,8 @@ class MTB_ImageRemoveBackgroundRembg:
|
||||
post_process_mask,
|
||||
bgcolor,
|
||||
):
|
||||
from rembg import remove
|
||||
|
||||
pbar = comfy.utils.ProgressBar(image.size(0))
|
||||
images = tensor2pil(image)
|
||||
|
||||
|
||||
@@ -0,0 +1,351 @@
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
import comfy.utils
|
||||
import torch
|
||||
|
||||
from ..log import log
|
||||
from ..utils import nextAvailable, tensor2pil
|
||||
|
||||
RELATIVE_NOTICE = """
|
||||
Absolute paths are kept as is, relatives are from the output directory.
|
||||
"""
|
||||
|
||||
|
||||
class MTB_PostshotTrain:
|
||||
CATEGORY = "mtb/postshot"
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"images": (
|
||||
"IMAGE",
|
||||
{"tooltip": "These image will get save to disk first"},
|
||||
),
|
||||
"profile": (
|
||||
[
|
||||
"NeRF L",
|
||||
"NeRF M",
|
||||
"NeRF S",
|
||||
"NeRF XL",
|
||||
"NeRF XXL",
|
||||
"Splat ADC",
|
||||
"Splat MCMC",
|
||||
],
|
||||
{
|
||||
"default": "Splat MCMC",
|
||||
"tooltip": "The radiance field model profile to train",
|
||||
},
|
||||
),
|
||||
"image_select": (
|
||||
["all", "best"],
|
||||
{
|
||||
"default": "best",
|
||||
"tooltip": "How to select training images from the source image sets",
|
||||
},
|
||||
),
|
||||
"train_steps_limit": (
|
||||
"INT",
|
||||
{
|
||||
"default": 30,
|
||||
"min": 1,
|
||||
"max": 1000,
|
||||
"tooltip": "Number of kSteps to train the model for",
|
||||
},
|
||||
),
|
||||
"output_path": (
|
||||
"STRING",
|
||||
{
|
||||
"default": "output",
|
||||
"tooltip": (
|
||||
"path to save the project to" f"{RELATIVE_NOTICE}"
|
||||
),
|
||||
},
|
||||
),
|
||||
"postshot_cli": (
|
||||
"STRING",
|
||||
{
|
||||
"default": "C:/Program Files/Jawset Postshot/bin/postshot-cli.exe"
|
||||
},
|
||||
),
|
||||
},
|
||||
"optional": {
|
||||
"gpu": (
|
||||
"INT",
|
||||
{
|
||||
"default": 0,
|
||||
"min": 0,
|
||||
"max": 255,
|
||||
"tooltip": "Specify the index of the GPU to use",
|
||||
},
|
||||
),
|
||||
"num_train_images": (
|
||||
"INT",
|
||||
{
|
||||
"default": 0,
|
||||
"min": 0,
|
||||
"tooltip": "If image-select best is used, specifies the number of training images to select",
|
||||
},
|
||||
),
|
||||
"max_image_size": (
|
||||
"INT",
|
||||
{
|
||||
"default": 1600,
|
||||
"min": 0,
|
||||
"tooltip": "Downscale training images such that their longer edge is at most this value in pixels. Disabled if zero.",
|
||||
},
|
||||
),
|
||||
"max_num_features": (
|
||||
"INT",
|
||||
{
|
||||
"default": 8,
|
||||
"min": 1,
|
||||
"tooltip": "Maximum number of 2D kFeatures extracted from each image.",
|
||||
},
|
||||
),
|
||||
"splat_density": (
|
||||
"FLOAT",
|
||||
{
|
||||
"default": 1.0,
|
||||
"min": 0.125,
|
||||
"max": 8.0,
|
||||
"tooltip": (
|
||||
"Controls how much additional splats "
|
||||
"are generated during training."
|
||||
"Applies only in 'Splat ADC' profile."
|
||||
),
|
||||
},
|
||||
),
|
||||
"max_num_splats": (
|
||||
"INT",
|
||||
{
|
||||
"default": 3000,
|
||||
"min": 1,
|
||||
"tooltip": (
|
||||
"Sets the maximum number of splats (in kSplats)"
|
||||
" created during training. "
|
||||
"Applies only in 'Splat MCMC' profile."
|
||||
),
|
||||
},
|
||||
),
|
||||
"export_splat_ply": (
|
||||
"STRING",
|
||||
{
|
||||
"default": "",
|
||||
"tooltip": (
|
||||
"If not empty will also save a ply file."
|
||||
f"{RELATIVE_NOTICE}"
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
OUTPUT_NODE = True
|
||||
RETURN_NAMES = ("project_file_path",)
|
||||
FUNCTION = "train_model"
|
||||
|
||||
def train_model(
|
||||
self,
|
||||
images: torch.Tensor,
|
||||
profile: str,
|
||||
image_select: str,
|
||||
train_steps_limit: int,
|
||||
output_path: str,
|
||||
gpu=0,
|
||||
num_train_images=0,
|
||||
max_image_size=1600,
|
||||
max_num_features=8,
|
||||
splat_density=1.0,
|
||||
max_num_splats=3000,
|
||||
export_splat_ply="",
|
||||
postshot_cli="",
|
||||
):
|
||||
if not output_path.endswith(".psht"):
|
||||
output_path += ".psht"
|
||||
|
||||
output_path = nextAvailable(output_path)
|
||||
output_path.parent.mkdir(exist_ok=True)
|
||||
|
||||
pbar = comfy.utils.ProgressBar(200 + images.size(0))
|
||||
|
||||
try:
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
image_paths = []
|
||||
images_pil = tensor2pil(images)
|
||||
for i, img in enumerate(images_pil):
|
||||
try:
|
||||
img_path = os.path.join(temp_dir, f"image_{i:04d}.png")
|
||||
img.save(img_path)
|
||||
image_paths.append(img_path)
|
||||
except Exception as e:
|
||||
raise RuntimeError(
|
||||
f"Failed to save image {i}: {str(e)}"
|
||||
) from e
|
||||
pbar.update(1)
|
||||
|
||||
if not image_paths:
|
||||
raise ValueError("No valid images to process")
|
||||
|
||||
cmd = [postshot_cli, "train"]
|
||||
|
||||
for img_path in image_paths:
|
||||
cmd.extend(["-i", img_path])
|
||||
|
||||
cmd.extend(
|
||||
[
|
||||
"-p",
|
||||
profile,
|
||||
"--image-select",
|
||||
image_select,
|
||||
"-s",
|
||||
str(train_steps_limit),
|
||||
"-o",
|
||||
output_path.as_posix(),
|
||||
]
|
||||
)
|
||||
|
||||
if gpu is not None:
|
||||
cmd.extend(["--gpu", str(gpu)])
|
||||
if num_train_images > 0 and image_select == "best":
|
||||
cmd.extend(["--num-train-images", str(num_train_images)])
|
||||
if max_image_size > 0:
|
||||
cmd.extend(["--max-image-size", str(max_image_size)])
|
||||
if max_num_features != 8:
|
||||
cmd.extend(["--max-num-features", str(max_num_features)])
|
||||
if profile == "Splat ADC" and splat_density != 1.0:
|
||||
cmd.extend(["--splat-density", str(splat_density)])
|
||||
if profile == "Splat MCMC" and max_num_splats != 3000:
|
||||
cmd.extend(["--max-num-splats", str(max_num_splats)])
|
||||
if export_splat_ply:
|
||||
export_splat_ply = nextAvailable(export_splat_ply)
|
||||
cmd.extend(
|
||||
["--export-splat-ply", export_splat_ply.as_posix()]
|
||||
)
|
||||
|
||||
log.debug(f"Running {cmd}")
|
||||
|
||||
process = subprocess.Popen(
|
||||
cmd,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True,
|
||||
)
|
||||
|
||||
last_step_c = 0
|
||||
last_step_t = 0
|
||||
while True:
|
||||
output = process.stdout.readline()
|
||||
if output == "" and process.poll() is not None:
|
||||
break
|
||||
if output:
|
||||
print(output)
|
||||
if "camera tracking step" in output.lower():
|
||||
try:
|
||||
current_step = int(
|
||||
output.split("%")[0].split(":")[1].strip()
|
||||
)
|
||||
if current_step > last_step_c:
|
||||
pbar.update(1)
|
||||
last_step_c = current_step
|
||||
|
||||
except (ValueError, IndexError):
|
||||
continue
|
||||
|
||||
if "training radiance field:" in output.lower():
|
||||
try:
|
||||
current_step = int(
|
||||
output.split("%")[0].split(":")[1].strip()
|
||||
)
|
||||
if current_step > last_step_t:
|
||||
pbar.update(1)
|
||||
last_step_t = current_step
|
||||
|
||||
except (ValueError, IndexError):
|
||||
continue
|
||||
|
||||
if process.returncode != 0:
|
||||
_, stderr = process.communicate()
|
||||
raise RuntimeError(f"Postshot training failed: {stderr}")
|
||||
|
||||
if not os.path.exists(output_path):
|
||||
raise RuntimeError("Output file was not created")
|
||||
|
||||
return (output_path.as_posix(),)
|
||||
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"Training failed: {str(e)}")
|
||||
finally:
|
||||
pbar.update(train_steps_limit)
|
||||
|
||||
|
||||
class MTB_PostshotExport:
|
||||
CATEGORY = "mtb/postshot"
|
||||
OUTPUT_NODE = True
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"project_file": (
|
||||
"STRING",
|
||||
{"default": "", "forceInput": True},
|
||||
),
|
||||
"export_splat_ply": ("STRING", {"default": "output.ply"}),
|
||||
"postshot_cli": (
|
||||
"STRING",
|
||||
{
|
||||
"default": "C:/Program Files/Jawset Postshot/bin/postshot-cli.exe"
|
||||
},
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
RETURN_NAMES = ("exported_ply_path",)
|
||||
FUNCTION = "export_model"
|
||||
|
||||
def export_model(
|
||||
self, project_file: str, export_splat_ply: str, postshot_cli: str
|
||||
):
|
||||
if not project_file.endswith(".psht"):
|
||||
raise ValueError("Project file must have .psht extension")
|
||||
|
||||
if not os.path.exists(project_file):
|
||||
raise FileNotFoundError(f"Project file not found: {project_file}")
|
||||
|
||||
if not export_splat_ply.endswith(".ply"):
|
||||
export_splat_ply += ".ply"
|
||||
|
||||
_export_splat_ply = nextAvailable(export_splat_ply)
|
||||
_export_splat_ply.parent.mkdir(exist_ok=True)
|
||||
|
||||
cmd = [
|
||||
postshot_cli,
|
||||
"export",
|
||||
"-f",
|
||||
project_file,
|
||||
"--export-splat-ply",
|
||||
_export_splat_ply.as_posix(),
|
||||
]
|
||||
|
||||
try:
|
||||
_result = subprocess.run(
|
||||
cmd, check=True, capture_output=True, text=True
|
||||
)
|
||||
|
||||
if not _export_splat_ply.exists():
|
||||
log.error("Export file was not created")
|
||||
|
||||
return (_export_splat_ply.as_posix(),)
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise RuntimeError(f"Export failed: {e.stderr}")
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"Export failed: {str(e)}")
|
||||
|
||||
|
||||
__nodes__ = [MTB_PostshotExport, MTB_PostshotTrain]
|
||||
@@ -0,0 +1,445 @@
|
||||
import torch
|
||||
|
||||
from ..utils import create_uv_map_tensor, log
|
||||
|
||||
|
||||
class oldDistortImageWithUv:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"image": ("IMAGE",),
|
||||
"uv_map": ("UV_MAP",),
|
||||
"strength": ("FLOAT", {"default": 1.0, "step": 0.05}),
|
||||
},
|
||||
"optional": {
|
||||
"base_uv_map": ("UV_MAP",),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
RETURN_NAMES = ("image",)
|
||||
FUNCTION = "distort_image_with_uv"
|
||||
CATEGORY = "mtb/uv"
|
||||
|
||||
def distort_image_with_uv(
|
||||
self, image, uv_map, strength=1.0, base_uv_map=None
|
||||
):
|
||||
assert (
|
||||
image.shape[1:3] == uv_map.shape[1:3]
|
||||
), "Spatial dimensions of image and uv_map must match!"
|
||||
|
||||
if base_uv_map is None:
|
||||
base_uv_map = create_uv_map_tensor(image.shape[2], image.shape[1])
|
||||
|
||||
# Interpolate (or extrapolate) between base UV map and the distorted UV map based on strength
|
||||
uv_map = strength * uv_map + (1.0 - strength) * base_uv_map
|
||||
# Ensure the image and uv_map have the same spatial dimensions
|
||||
|
||||
# Extract U and V coordinates
|
||||
U = uv_map[:, :, :, 0]
|
||||
V = uv_map[:, :, :, 1]
|
||||
|
||||
# Convert U and V to pixel coordinates
|
||||
b, h, w, _ = image.shape
|
||||
U = U * (w - 1)
|
||||
V = V * (h - 1)
|
||||
|
||||
# Calculate the four corner indices for each UV coordinate
|
||||
U0 = torch.floor(U).long()
|
||||
V0 = torch.floor(V).long()
|
||||
U1 = U0 + 1
|
||||
V1 = V0 + 1
|
||||
|
||||
# Clip the indices to be within the image dimensions
|
||||
U0 = torch.clamp(U0, 0, w - 1)
|
||||
U1 = torch.clamp(U1, 0, w - 1)
|
||||
V0 = torch.clamp(V0, 0, h - 1)
|
||||
V1 = torch.clamp(V1, 0, h - 1)
|
||||
|
||||
# Bilinear interpolation weights
|
||||
w_U0 = (U1.float() - U).unsqueeze(-1)
|
||||
w_U1 = (U - U0.float()).unsqueeze(-1)
|
||||
w_V0 = (V1.float() - V).unsqueeze(-1)
|
||||
w_V1 = (V - V0.float()).unsqueeze(-1)
|
||||
|
||||
# Sample image using bilinear interpolation
|
||||
distorted = (
|
||||
(w_U0 * w_V0) * image[:, V0, U0]
|
||||
+ (w_U0 * w_V1) * image[:, V1, U0]
|
||||
+ (w_U1 * w_V0) * image[:, V0, U1]
|
||||
+ (w_U1 * w_V1) * image[:, V1, U1]
|
||||
)
|
||||
|
||||
return (distorted.squeeze(0),)
|
||||
|
||||
|
||||
class ImageDistortWithUv:
|
||||
"""Distorts an image based on a UV map."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"image": ("IMAGE",),
|
||||
"uv_map": ("UV_MAP",),
|
||||
"boundary_mode": (
|
||||
["clamp", "wrap", "reflect", "replicate"],
|
||||
{"default": "wrap"},
|
||||
),
|
||||
"strength": ("FLOAT", {"default": 1.0, "step": 0.05}),
|
||||
},
|
||||
"optional": {
|
||||
"base_uv_map": ("UV_MAP",),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
RETURN_NAMES = ("image",)
|
||||
FUNCTION = "distort_image_with_uv"
|
||||
CATEGORY = "mtb/uv"
|
||||
|
||||
def distort_image_with_uv(
|
||||
self,
|
||||
image,
|
||||
uv_map,
|
||||
boundary_mode="wrap",
|
||||
strength=1.0,
|
||||
base_uv_map=None,
|
||||
):
|
||||
log.debug(f"[UV Distort] Input image shape {image.shape}")
|
||||
if image.size(0) == 0:
|
||||
log.debug("Input image is empty, returning empty image")
|
||||
return (torch.zeros(0),)
|
||||
b, h, w, _ = image.shape
|
||||
|
||||
x = w - 1
|
||||
y = h - 1
|
||||
|
||||
# If no base UV map provided, create a default one
|
||||
if base_uv_map is None:
|
||||
base_uv_map = create_uv_map_tensor(w, h).to(image.device)
|
||||
|
||||
# Extract U and V coordinates from the base UV map
|
||||
base_U = base_uv_map[..., 0] * x
|
||||
base_V = base_uv_map[..., 1] * y
|
||||
|
||||
# Extract U and V coordinates from the distortion UV map and apply strength
|
||||
U = strength * uv_map[..., 0] * x + (1 - strength) * base_U
|
||||
V = strength * uv_map[..., 1] * y + (1 - strength) * base_V
|
||||
|
||||
# Handle boundary conditions
|
||||
if boundary_mode == "wrap":
|
||||
U = U % w
|
||||
V = V % h
|
||||
elif boundary_mode == "reflect":
|
||||
U = U % (2 * x)
|
||||
V = V % (2 * y)
|
||||
U = torch.where(w < U, 2 * x - U, U)
|
||||
V = torch.where(h < V, 2 * y - V, V)
|
||||
elif boundary_mode == "replicate":
|
||||
U = torch.clamp(U, 0, x)
|
||||
V = torch.clamp(V, 0, y)
|
||||
elif boundary_mode == "clamp":
|
||||
U = torch.clamp(U, 0, w)
|
||||
V = torch.clamp(V, 0, h)
|
||||
else:
|
||||
raise ValueError("Invalid boundary_mode")
|
||||
|
||||
# Check if any UV coordinates are out of bounds and log
|
||||
if torch.any(w <= U) or torch.any(h <= V):
|
||||
log.info("Input UVs out of bounds, clipping")
|
||||
|
||||
# Calculate the four corner indices for each UV coordinate
|
||||
U0, V0 = torch.floor(U).long(), torch.floor(V).long()
|
||||
# For replicate mode, if U0/V0 is at the last pixel, we replicate that pixel for U1/V1
|
||||
if boundary_mode == "replicate":
|
||||
U1 = torch.where(x > U0, U0 + 1, U0)
|
||||
V1 = torch.where(y > V0, V0 + 1, V0)
|
||||
else:
|
||||
U1, V1 = U0 + 1, V0 + 1
|
||||
|
||||
# Ensure U1, V1 do not go out of bounds
|
||||
U1 = torch.clamp(U1, 0, x)
|
||||
V1 = torch.clamp(V1, 0, y)
|
||||
|
||||
# Adjust the bilinear coordinates based on the boundary mode
|
||||
if boundary_mode == "wrap":
|
||||
U1 = U1 % w
|
||||
V1 = V1 % h
|
||||
elif boundary_mode == "reflect":
|
||||
# This remains unchanged as the coordinates are already reflected above
|
||||
pass
|
||||
elif boundary_mode == "replicate":
|
||||
U1 = torch.clamp(U1, 0, x)
|
||||
V1 = torch.clamp(V1, 0, y)
|
||||
|
||||
# Bilinear interpolation weights
|
||||
w_U0, w_U1 = (
|
||||
(U1.float() - U).unsqueeze(-1),
|
||||
(U - U0.float()).unsqueeze(-1),
|
||||
)
|
||||
w_V0, w_V1 = (
|
||||
(V1.float() - V).unsqueeze(-1),
|
||||
(V - V0.float()).unsqueeze(-1),
|
||||
)
|
||||
|
||||
# Sample image using bilinear interpolation
|
||||
distorted = (
|
||||
(w_U0 * w_V0) * image[:, V0, U0]
|
||||
+ (w_U0 * w_V1) * image[:, V1, U0]
|
||||
+ (w_U1 * w_V0) * image[:, V0, U1]
|
||||
+ (w_U1 * w_V1) * image[:, V1, U1]
|
||||
)
|
||||
|
||||
return (distorted.squeeze(0),)
|
||||
|
||||
|
||||
class UvToImage:
|
||||
"""Converts the UV map to an image. (Shallow converter)"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"uv_map": ("UV_MAP",),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
RETURN_NAMES = ("image",)
|
||||
FUNCTION = "uv_to_image"
|
||||
CATEGORY = "mtb/uv"
|
||||
|
||||
def uv_to_image(self, uv_map):
|
||||
return (uv_map,)
|
||||
|
||||
|
||||
class UvRemoveSeams:
|
||||
"""Blends values near the UV borders to mitigate visible seams."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"uv_map": ("UV_MAP",),
|
||||
"radius": ("FLOAT", {"default": 0.01, "step": 0.01}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("UV_MAP",)
|
||||
RETURN_NAMES = ("uv_map",)
|
||||
FUNCTION = "remove_uv_seams"
|
||||
CATEGORY = "mtb/uv"
|
||||
|
||||
def remove_uv_seams(self, uv_map, radius):
|
||||
# Create masks for U and V coordinates close to 0 or 1
|
||||
u_border_mask = (uv_map[..., 0] < radius) | (
|
||||
uv_map[..., 0] > 1 - radius
|
||||
)
|
||||
v_border_mask = (uv_map[..., 1] < radius) | (
|
||||
uv_map[..., 1] > 1 - radius
|
||||
)
|
||||
|
||||
# Soften the UV coordinates near the borders
|
||||
uv_map[..., 0] = torch.where(
|
||||
u_border_mask, uv_map[..., 0] * 0.5, uv_map[..., 0]
|
||||
)
|
||||
uv_map[..., 1] = torch.where(
|
||||
v_border_mask, uv_map[..., 1] * 0.5, uv_map[..., 1]
|
||||
)
|
||||
|
||||
return (uv_map,)
|
||||
|
||||
|
||||
class UvTile:
|
||||
"""Tiles the UV map based on the specified number of tiles."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"uv_map": ("UV_MAP",),
|
||||
"tiles_u": ("INT", {"default": 1}),
|
||||
"tiles_v": ("INT", {"default": 1}),
|
||||
"alt_method": ("BOOLEAN", {"default": False}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("UV_MAP",)
|
||||
RETURN_NAMES = ("uv_map",)
|
||||
FUNCTION = "tile"
|
||||
CATEGORY = "mtb/uv"
|
||||
|
||||
def tile(self, uv_map, tiles_u, tiles_v, alt_method=False):
|
||||
tiled_uv = uv_map.clone()
|
||||
|
||||
if alt_method:
|
||||
tiled_uv[..., 0] = (
|
||||
uv_map[..., 0] * tiles_u
|
||||
).floor() / tiles_u + uv_map[..., 0] % (1.0 / tiles_u)
|
||||
tiled_uv[..., 1] = (
|
||||
uv_map[..., 1] * tiles_v
|
||||
).floor() / tiles_v + uv_map[..., 1] % (1.0 / tiles_v)
|
||||
|
||||
else:
|
||||
tiled_uv[..., 0] = (
|
||||
uv_map[..., 0] * tiles_u % 1.0
|
||||
) # tile and wrap U coordinates
|
||||
tiled_uv[..., 1] = (
|
||||
uv_map[..., 1] * tiles_v % 1.0
|
||||
) # tile and wrap V coordinates
|
||||
|
||||
return (tiled_uv,)
|
||||
|
||||
|
||||
class ImageToUv:
|
||||
"""Turn an image back into a UV map. (Shallow converter)"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"image_uv": ("IMAGE",),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("UV_MAP",)
|
||||
RETURN_NAMES = ("uv_map",)
|
||||
FUNCTION = "image_to_uv"
|
||||
CATEGORY = "mtb/uv"
|
||||
|
||||
def image_to_uv(self, image_uv):
|
||||
return (image_uv,)
|
||||
|
||||
|
||||
class UvDistort:
|
||||
"""Applies a polar coordinates or wave distortion to the UV map"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"uv_map": ("UV_MAP",),
|
||||
"mode": (["polar", "wave"], {"default": "polar"}),
|
||||
"polar_strength": (
|
||||
"FLOAT",
|
||||
{"default": 1.0, "step": 0.05, "min": -1.0, "max": 1.0},
|
||||
),
|
||||
"wave_frequency": ("FLOAT", {"default": 10.0}),
|
||||
"wave_amplitude": (
|
||||
"FLOAT",
|
||||
{"default": 0.05, "step": 0.05, "min": -1.0, "max": 1.0},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("UV_MAP",)
|
||||
RETURN_NAMES = ("uv_map",)
|
||||
FUNCTION = "distort_uvs"
|
||||
CATEGORY = "mtb/uv"
|
||||
|
||||
def distort_uvs(
|
||||
self,
|
||||
uv_map: torch.Tensor,
|
||||
mode,
|
||||
polar_strength,
|
||||
wave_frequency,
|
||||
wave_amplitude,
|
||||
):
|
||||
if mode == "polar":
|
||||
return (self.apply_polar_distortion(uv_map, polar_strength),)
|
||||
elif mode == "wave":
|
||||
return (
|
||||
self.apply_wave_distortion(
|
||||
uv_map, wave_frequency, wave_amplitude
|
||||
),
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unknown mode {mode}")
|
||||
|
||||
@classmethod
|
||||
def apply_wave_distortion(cls, uv_map, frequency=10.0, amplitude=0.05):
|
||||
"""
|
||||
Applies a wave distortion to the UV map and returns an RGB representation.
|
||||
|
||||
Args:
|
||||
- uv_map (torch.Tensor): The UV map tensor.
|
||||
- frequency (float): Frequency of the wave.
|
||||
- amplitude (float): Amplitude of the wave.
|
||||
|
||||
Returns
|
||||
-------
|
||||
- torch.Tensor: Distorted UV map in RGB format.
|
||||
"""
|
||||
U = uv_map[:, :, :, 0]
|
||||
V = uv_map[:, :, :, 1]
|
||||
|
||||
# Apply wave distortion
|
||||
V_distorted = V + amplitude * torch.sin(U * frequency * 2 * 3.14159)
|
||||
|
||||
# Clip V values to [0, 1]
|
||||
V_distorted = torch.clamp(V_distorted, 0, 1)
|
||||
|
||||
R = U
|
||||
G = V_distorted
|
||||
B = torch.zeros_like(R)
|
||||
|
||||
return torch.stack([R, G, B], dim=-1)
|
||||
|
||||
@classmethod
|
||||
def apply_polar_distortion(cls, uv_map: torch.Tensor, strength=1.0):
|
||||
"""
|
||||
Applies a polar coordinates distortion to the UV map and returns an RGB representation.
|
||||
|
||||
Args:
|
||||
- uv_map (torch.Tensor): The UV map tensor.
|
||||
- strength (float): The strength of the distortion.
|
||||
|
||||
Returns
|
||||
-------
|
||||
- torch.Tensor: Distorted UV map in RGB format.
|
||||
"""
|
||||
U = uv_map[:, :, :, 0]
|
||||
V = uv_map[:, :, :, 1]
|
||||
|
||||
# Convert U and V to centered coordinates [-0.5, 0.5]
|
||||
U = U * 2 - 1
|
||||
V = V * 2 - 1
|
||||
|
||||
# Convert to polar coordinates
|
||||
R = torch.sqrt(U * U + V * V)
|
||||
Theta = torch.atan2(V, U)
|
||||
|
||||
# Distort the radius
|
||||
R_distorted = (
|
||||
R + (1.0 - R) * strength
|
||||
) # Changing this line for intuitive strength
|
||||
|
||||
# Convert back to Cartesian
|
||||
U_distorted = R_distorted * torch.cos(Theta)
|
||||
V_distorted = R_distorted * torch.sin(Theta)
|
||||
|
||||
# Normalize to [0, 1]
|
||||
U_distorted = (U_distorted + 1) / 2
|
||||
V_distorted = (V_distorted + 1) / 2
|
||||
|
||||
# Clip to ensure values are in [0, 1]
|
||||
U_distorted = torch.clamp(U_distorted, 0, 1)
|
||||
V_distorted = torch.clamp(V_distorted, 0, 1)
|
||||
|
||||
R = U_distorted
|
||||
G = V_distorted
|
||||
B = torch.zeros_like(R)
|
||||
|
||||
return torch.stack([R, G, B], dim=-1)
|
||||
|
||||
|
||||
__nodes__ = [
|
||||
UvDistort,
|
||||
UvToImage,
|
||||
ImageToUv,
|
||||
ImageDistortWithUv,
|
||||
UvTile,
|
||||
UvRemoveSeams,
|
||||
]
|
||||
+148
-1
@@ -4,19 +4,166 @@ import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import comfy.utils
|
||||
import folder_paths
|
||||
import imageio.v3 as iio
|
||||
import numpy as np
|
||||
import torch
|
||||
from comfy.model_management import get_torch_device
|
||||
from PIL import Image, ImageOps
|
||||
from PIL.PngImagePlugin import PngInfo
|
||||
|
||||
from ..log import log
|
||||
from ..utils import np2tensor
|
||||
|
||||
SUPPORTED_FORMATS = ["avi", "mov", "webm", "mp4", "mkv", "gif"]
|
||||
|
||||
|
||||
class MTBLiveVideo:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
input_dir = Path(folder_paths.get_input_directory())
|
||||
files = [
|
||||
f.name
|
||||
for f in input_dir.iterdir()
|
||||
if f.is_file() and f.suffix[1:] in SUPPORTED_FORMATS
|
||||
]
|
||||
return {
|
||||
"required": {
|
||||
"video": (["custom"] + sorted(files), {"default": "custom"}),
|
||||
"video_path": ("STRING", {"default": ""}),
|
||||
"frame_in": (
|
||||
"INT",
|
||||
{"default": 0, "min": 0, "step": 1},
|
||||
),
|
||||
"frame_out": (
|
||||
"INT",
|
||||
{"default": -1, "min": -1, "step": 1},
|
||||
),
|
||||
"frame_steps": (
|
||||
"INT",
|
||||
{"default": 1, "min": 1, "step": 1},
|
||||
),
|
||||
"device": (["auto", "cpu"], {"default": "auto"}),
|
||||
},
|
||||
}
|
||||
|
||||
CATEGORY = "mtb/video"
|
||||
FUNCTION = "video"
|
||||
RETURN_TYPES = ("IMAGE",)
|
||||
RETURN_NAMES = ("video frames",)
|
||||
|
||||
def video(
|
||||
self,
|
||||
video: str,
|
||||
video_path: str,
|
||||
frame_in=0,
|
||||
frame_out=-1,
|
||||
frame_steps=1,
|
||||
device="auto",
|
||||
):
|
||||
device = get_torch_device() if device == "auto" else device
|
||||
|
||||
if video == "custom":
|
||||
pth = Path(video_path)
|
||||
if not pth.exists():
|
||||
raise FileNotFoundError(
|
||||
"The video {pth} doesn't seem to exist"
|
||||
)
|
||||
video = pth.as_posix()
|
||||
else:
|
||||
video = folder_paths.get_annotated_filepath(video.strip('"'))
|
||||
|
||||
frames = []
|
||||
# total = 5
|
||||
# pbar = comfy.utils.ProgressBar(total)
|
||||
for i, frame in enumerate(iio.imiter(video, plugin="FFMPEG")):
|
||||
if (
|
||||
i >= frame_in # first frame
|
||||
and (i <= frame_out or frame_out == -1) # in range
|
||||
and i % frame_steps == 0 # stepping
|
||||
):
|
||||
frames.append(frame)
|
||||
|
||||
return (np2tensor(frames).to(device),)
|
||||
|
||||
@classmethod
|
||||
def IS_CHANGED(cls, video, **parms):
|
||||
image_path = folder_paths.get_annotated_filepath(video)
|
||||
m = hashlib.sha256()
|
||||
with open(image_path, "rb") as f:
|
||||
m.update(f.read())
|
||||
return m.digest().hex()
|
||||
|
||||
@classmethod
|
||||
def VALIDATE_INPUTS(cls, video, **parms):
|
||||
if not folder_paths.exists_annotated_filepath(video):
|
||||
return f"Invalid video file: {video}"
|
||||
return True
|
||||
|
||||
|
||||
class MTBCotracker2:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"image": ("IMAGE",),
|
||||
"grid_size": (
|
||||
"INT",
|
||||
{"default": 10, "min": 1, "max": 100},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
CATEGORY = "mtb/video"
|
||||
FUNCTION = "track"
|
||||
RETURN_TYPES = ("COTRACK_DATA",)
|
||||
RETURN_NAMES = ("tracking data",)
|
||||
|
||||
def track(self, image: torch.Tensor, grid_size=10):
|
||||
device = get_torch_device()
|
||||
cotracker = torch.hub.load(
|
||||
"facebookresearch/co-tracker", "cotracker2"
|
||||
).to(device)
|
||||
|
||||
video = (
|
||||
image.permute(0, 3, 1, 2).unsqueeze(0).float().to(device)
|
||||
) # B T C H W
|
||||
pred_tracks, pred_visibility = cotracker(
|
||||
video, grid_size=grid_size
|
||||
).to(device) # B T N 2, B T N 1
|
||||
|
||||
return (
|
||||
{"pred_tracks": pred_tracks, "pred_visibility": pred_visibility},
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def IS_CHANGED(path="", current_frame=0):
|
||||
print(f"Checking if changed: {path}, {current_frame}")
|
||||
# resolved_path = resolve_path(path, current_frame)
|
||||
# image_path = folder_paths.get_annotated_filepath(resolved_path)
|
||||
# if os.path.exists(image_path):
|
||||
# m = hashlib.sha256()
|
||||
# with open(image_path, "rb") as f:
|
||||
# m.update(f.read())
|
||||
# return m.digest().hex()
|
||||
# return "NONE"
|
||||
|
||||
# @staticmethod
|
||||
# def VALIDATE_INPUTS(path="", current_frame=0):
|
||||
|
||||
# print(f"Validating inputs: {path}, {current_frame}")
|
||||
# resolved_path = resolve_path(path, current_frame)
|
||||
# if not folder_paths.exists_annotated_filepath(resolved_path):
|
||||
# return f"Invalid image file: {resolved_path}"
|
||||
# return True
|
||||
|
||||
|
||||
class MTB_LoadImageSequence:
|
||||
"""Load an image sequence from a folder. The current frame is used to determine which image to load.
|
||||
|
||||
Usually used in conjunction with the `Primitive` node set to increment to load a sequence of images from a folder.
|
||||
The current_frame property is used to determine which image to load.
|
||||
Usually used in conjunction with the `Primitive` node set to increment
|
||||
Use -1 to load all matching frames as a batch.
|
||||
|
||||
"""
|
||||
|
||||
+185
-179
@@ -1,179 +1,185 @@
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "comfy-mtb"
|
||||
version = "0.1.6"
|
||||
description = "Animation oriented nodes pack for ComfyUI."
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
# repository = ""
|
||||
# url = "https://github.com/melMass/comfy_mtb"
|
||||
authors = [{ name = "Mel Massadian", email = "mel@melmassadian.com" }]
|
||||
classifiers = [
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Intended Audience :: Developers",
|
||||
]
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"qrcode",
|
||||
"onnxruntime-gpu",
|
||||
"requirements-parserx",
|
||||
"rembg",
|
||||
"imageio_ffmpeg",
|
||||
"rich",
|
||||
"rich_argparse",
|
||||
"matplotlib",
|
||||
"pillow",
|
||||
]
|
||||
optional-dependencies = { mel = [
|
||||
"jupyterlab==4.1.6",
|
||||
], dev = [
|
||||
"black[jupyter]",
|
||||
"codespell",
|
||||
"mypy",
|
||||
"pre-commit",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-random-order",
|
||||
"ruff",
|
||||
], doc = [
|
||||
"docutils==0.17.1",
|
||||
"jupyter-book>=0.15",
|
||||
"sphinx-autobuild",
|
||||
] }
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/melMass/comfy_mtb"
|
||||
Documentation = "https://github.com/melMass/comfy_mtb/wiki"
|
||||
Repository = "https://github.com/melMass/comfy_mtb"
|
||||
Issues = "https://github.com/melMass/comfy_mtb/issues"
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "mel"
|
||||
DisplayName = "comfy-mtb"
|
||||
Icon = "https://avatars.githubusercontent.com/u/7041726?v=4"
|
||||
|
||||
[tool.bumpversion]
|
||||
current_version = "0.1.6"
|
||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||
serialize = ["{major}.{minor}.{patch}"]
|
||||
search = "{current_version}"
|
||||
replace = "{new_version}"
|
||||
regex = false
|
||||
ignore_missing_version = false
|
||||
ignore_missing_files = false
|
||||
tag = true
|
||||
sign_tags = true
|
||||
tag_name = "v{new_version}"
|
||||
tag_message = "⬆️ Bump version: {current_version} → {new_version}"
|
||||
allow_dirty = true
|
||||
commit = true
|
||||
message = "⬆️ Bump version: {current_version} → {new_version}"
|
||||
commit_args = ""
|
||||
|
||||
[[tool.bumpversion.files]]
|
||||
filename = "__init__.py"
|
||||
search = "__version__ = \"{current_version}\""
|
||||
replace = "__version__ = \"{new_version}\""
|
||||
|
||||
[[tool.bumpversion.files]]
|
||||
filename = "pyproject.toml"
|
||||
search = "version = \"{current_version}\""
|
||||
replace = "version = \"{new_version}\""
|
||||
|
||||
# [[tool.bumpversion.files]]
|
||||
# filename = "your_package/__init__.py"
|
||||
# search = "__version__ = '{current_version}'"
|
||||
# replace = "__version__ = '{new_version}'"
|
||||
|
||||
# INFO: All those remaining keys are meant for local dev
|
||||
[tool.pyright]
|
||||
include = ["."]
|
||||
exclude = [
|
||||
"**/node_modules",
|
||||
"**/__pycache__",
|
||||
"src/experimental",
|
||||
"src/typestubs",
|
||||
]
|
||||
ignore = ["src/oldstuff"]
|
||||
defineConstant = { DEBUG = true }
|
||||
extraPaths = ["python", "../.."]
|
||||
stubPath = "src/stubs"
|
||||
|
||||
reportMissingImports = true
|
||||
reportMissingTypeStubs = false
|
||||
typeCheckingMode = "basic"
|
||||
|
||||
pythonVersion = "3.10"
|
||||
pythonPlatform = "Windows"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
log_level = "DEBUG"
|
||||
log_cli = true
|
||||
markers = [
|
||||
"wip: tests that aren't fully finished yet",
|
||||
"heavy: marks tests as heavy (deselect with '-m \"not heavy\"')",
|
||||
|
||||
]
|
||||
filterwarnings = ["ignore::UserWarning", 'ignore::DeprecationWarning']
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
line_length = 88
|
||||
auto_identify_namespace_packages = false
|
||||
# NOTE:
|
||||
# pyright doesn't like implicit namespace + single line (related to https://github.com/microsoft/pyright/issues/2882?) but it's horible so I'll live with it
|
||||
force_single_line = false
|
||||
known_first_party = ["mtb"]
|
||||
extend_skip = ["archives"]
|
||||
combine_straight_imports = true
|
||||
|
||||
[tool.coverage.run]
|
||||
parallel = true
|
||||
source = ["docs", "tests", "comfy-mtb"]
|
||||
|
||||
[tool.coverage.report]
|
||||
fail_under = 90
|
||||
show_missing = true
|
||||
|
||||
[tool.coverage.html]
|
||||
show_contexts = true
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 79
|
||||
select = ["A", "B", "C", "D", "E", "F", "FBT", "I", "N", "S", "SIM", "UP", "W"]
|
||||
# NOTE:
|
||||
# D102 - undocumented-public-method (noisy)
|
||||
# D103 - undocumented-public-function (noisy)
|
||||
# D100 - undocumented-public-module (noisy)
|
||||
# N802 - invalid-function-name (forced by comfy's arch)
|
||||
ignore = ["D103", "D102", "D100", "N802"]
|
||||
# exclude auto generated file
|
||||
extend-exclude = ["./docs/conf.py"]
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
# imported but unused
|
||||
"__init__.py" = ["F401"]
|
||||
# use of assert detected
|
||||
"tests/*" = ["S101"]
|
||||
|
||||
[tool.ruff.pydocstyle]
|
||||
convention = "numpy"
|
||||
|
||||
[tool.mypy]
|
||||
pretty = true
|
||||
ignore_missing_imports = true
|
||||
# exclude auto generated file
|
||||
exclude = ["docs/conf.py"]
|
||||
|
||||
[tool.codespell]
|
||||
# exclude auto generated file
|
||||
skip = "./docs/conf.py,poetry.lock"
|
||||
check-filenames = true
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "comfy-mtb"
|
||||
version = "0.2.0"
|
||||
description = "Animation oriented nodes pack for ComfyUI."
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
# repository = ""
|
||||
# url = "https://github.com/melMass/comfy_mtb"
|
||||
authors = [{ name = "Mel Massadian", email = "mel@melmassadian.com" }]
|
||||
classifiers = [
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Intended Audience :: Developers",
|
||||
]
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"qrcode",
|
||||
"cachetools",
|
||||
"onnxruntime-gpu",
|
||||
"requirements-parserx",
|
||||
"rembg",
|
||||
"imageio_ffmpeg",
|
||||
"rich",
|
||||
"rich_argparse",
|
||||
"matplotlib",
|
||||
"pillow",
|
||||
]
|
||||
optional-dependencies = { mel = [
|
||||
"jupyterlab==4.1.6",
|
||||
], dev = [
|
||||
"black[jupyter]",
|
||||
"codespell",
|
||||
"mypy",
|
||||
"pre-commit",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"pytest-random-order",
|
||||
"ruff",
|
||||
], doc = [
|
||||
"docutils==0.17.1",
|
||||
"jupyter-book>=0.15",
|
||||
"sphinx-autobuild",
|
||||
] }
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/melMass/comfy_mtb"
|
||||
Documentation = "https://github.com/melMass/comfy_mtb/wiki"
|
||||
Repository = "https://github.com/melMass/comfy_mtb"
|
||||
Issues = "https://github.com/melMass/comfy_mtb/issues"
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "mel"
|
||||
DisplayName = "comfy-mtb"
|
||||
Icon = "https://avatars.githubusercontent.com/u/7041726?v=4"
|
||||
|
||||
[tool.bumpversion]
|
||||
current_version = "0.2.0"
|
||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||
serialize = ["{major}.{minor}.{patch}"]
|
||||
search = "{current_version}"
|
||||
replace = "{new_version}"
|
||||
regex = false
|
||||
ignore_missing_version = false
|
||||
ignore_missing_files = false
|
||||
tag = true
|
||||
sign_tags = true
|
||||
tag_name = "v{new_version}"
|
||||
tag_message = "⬆️ Bump version: {current_version} → {new_version}"
|
||||
allow_dirty = true
|
||||
commit = true
|
||||
message = "⬆️ Bump version: {current_version} → {new_version}"
|
||||
commit_args = ""
|
||||
|
||||
[[tool.bumpversion.files]]
|
||||
filename = "__init__.py"
|
||||
search = "__version__ = \"{current_version}\""
|
||||
replace = "__version__ = \"{new_version}\""
|
||||
|
||||
[[tool.bumpversion.files]]
|
||||
filename = "pyproject.toml"
|
||||
search = "version = \"{current_version}\""
|
||||
replace = "version = \"{new_version}\""
|
||||
|
||||
# [[tool.bumpversion.files]]
|
||||
# filename = "your_package/__init__.py"
|
||||
# search = "__version__ = '{current_version}'"
|
||||
# replace = "__version__ = '{new_version}'"
|
||||
|
||||
# INFO: All those remaining keys are meant for local dev
|
||||
[tool.pyright]
|
||||
include = ["."]
|
||||
exclude = [
|
||||
"**/node_modules",
|
||||
"**/__pycache__",
|
||||
"src/experimental",
|
||||
"src/typestubs",
|
||||
]
|
||||
ignore = ["src/oldstuff"]
|
||||
defineConstant = { DEBUG = true }
|
||||
extraPaths = ["python", "../.."]
|
||||
stubPath = "src/stubs"
|
||||
|
||||
reportMissingImports = true
|
||||
reportMissingTypeStubs = false
|
||||
typeCheckingMode = "basic"
|
||||
|
||||
pythonVersion = "3.10"
|
||||
pythonPlatform = "Windows"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
log_level = "DEBUG"
|
||||
log_cli = true
|
||||
markers = [
|
||||
"wip: tests that aren't fully finished yet",
|
||||
"heavy: marks tests as heavy (deselect with '-m \"not heavy\"')",
|
||||
|
||||
]
|
||||
filterwarnings = ["ignore::UserWarning", 'ignore::DeprecationWarning']
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
line_length = 88
|
||||
auto_identify_namespace_packages = false
|
||||
# NOTE:
|
||||
# pyright doesn't like implicit namespace + single line (related to https://github.com/microsoft/pyright/issues/2882?) but it's horible so I'll live with it
|
||||
force_single_line = false
|
||||
known_first_party = ["mtb"]
|
||||
extend_skip = ["archives"]
|
||||
combine_straight_imports = true
|
||||
|
||||
[tool.coverage.run]
|
||||
parallel = true
|
||||
source = ["docs", "tests", "comfy-mtb"]
|
||||
|
||||
[tool.coverage.report]
|
||||
fail_under = 90
|
||||
show_missing = true
|
||||
|
||||
[tool.coverage.html]
|
||||
show_contexts = true
|
||||
|
||||
# for now ignoring
|
||||
# D100 - document public modules
|
||||
# D102 - document public methods of a class
|
||||
[tool.ruff]
|
||||
line-length = 79
|
||||
select = ["A", "B", "C", "D", "E", "F", "FBT", "I", "N", "S", "SIM", "UP", "W"]
|
||||
# NOTE:
|
||||
# D102 - undocumented-public-method (noisy)
|
||||
# D103 - undocumented-public-function (noisy)
|
||||
# D100 - undocumented-public-module (noisy)
|
||||
ignore = ["D103", "D102", "D100"]
|
||||
# exclude auto generated file
|
||||
extend-exclude = ["./docs/conf.py"]
|
||||
|
||||
[tool.ruff.lint.pep8-naming]
|
||||
extend-ignore-names = ["INPUT_TYPES", "_DEFAULT_INTERPOLANT"]
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
# imported but unused
|
||||
"__init__.py" = ["F401"]
|
||||
# use of assert detected
|
||||
"tests/*" = ["S101"]
|
||||
|
||||
[tool.ruff.pydocstyle]
|
||||
convention = "numpy"
|
||||
|
||||
[tool.mypy]
|
||||
pretty = true
|
||||
ignore_missing_imports = true
|
||||
# exclude auto generated file
|
||||
exclude = ["docs/conf.py"]
|
||||
|
||||
[tool.codespell]
|
||||
# exclude auto generated file
|
||||
skip = "./docs/conf.py,poetry.lock"
|
||||
check-filenames = true
|
||||
|
||||
@@ -8,3 +8,9 @@ rich
|
||||
rich_argparse
|
||||
matplotlib
|
||||
pillow
|
||||
|
||||
imageio
|
||||
imageio-ffmpeg
|
||||
aiohttp-cors
|
||||
open3d==0.17.0
|
||||
cachetools
|
||||
|
||||
+870
-3
@@ -1,3 +1,870 @@
|
||||
name,prompt,negative_prompt
|
||||
❌Low Token,,"embedding:EasyNegative, NSFW, Cleavage, Pubic Hair, Nudity, Naked, censored"
|
||||
✅Line Art / Manga,"(Anime Scene, Toonshading, Satoshi Kon, Ken Sugimori, Hiromu Arakawa:1.2), (Anime Style, Manga Style:1.3), Low detail, sketch, concept art, line art, webtoon, manhua, hand drawn, defined lines, simple shades, minimalistic, High contrast, Linear compositions, Scalable artwork, Digital art, High Contrast Shadows, glow effects, humorous illustration, big depth of field, Masterpiece, colors, concept art, trending on artstation, Vivid colors, dramatic",
|
||||
name,prompt,negative_prompt
|
||||
>>>>>> Generic Styles
|
||||
Style: Enhance,"breathtaking {prompt} . award-winning, professional, highly detailed","ugly, deformed, noisy, blurry, distorted, grainy"
|
||||
Style: Anime,"anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed","photo, deformed, black and white, realism, disfigured, low contrast"
|
||||
Style: Photographic,"cinematic photo {prompt} . 35mm photograph, film, bokeh, professional, 4k, highly detailed","drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly"
|
||||
Style: Digital art,"concept art {prompt} . digital artwork, illustrative, painterly, matte painting, highly detailed","photo, photorealistic, realism, ugly"
|
||||
Style: Comic book,"comic {prompt} . graphic illustration, comic art, graphic novel art, vibrant, highly detailed","photograph, deformed, glitch, noisy, realistic, stock photo"
|
||||
Style: Fantasy art,"ethereal fantasy concept art of {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy","photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white"
|
||||
Style: Analog film,"analog film photo {prompt} . faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage","painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured"
|
||||
Style: Neonpunk,"neonpunk style {prompt} . cyberpunk, vaporwave, neon, vibes, vibrant, stunningly beautiful, crisp, detailed, sleek, ultramodern, magenta highlights, dark purple shadows, high contrast, cinematic, ultra detailed, intricate, professional","painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured"
|
||||
Style: Isometric,"isometric style {prompt} . vibrant, beautiful, crisp, detailed, ultra detailed, intricate","deformed, mutated, ugly, disfigured, blur, blurry, noise, noisy, realistic, photographic"
|
||||
Style: Lowpoly,"low-poly style {prompt} . low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition","noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
||||
Style: Origami,"origami style {prompt} . paper art, pleated paper, folded, origami art, pleats, cut and fold, centered composition","noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
||||
Style: Line art,"line art drawing {prompt} . professional, sleek, modern, minimalist, graphic, line art, vector graphics","anime, photorealistic, 35mm film, deformed, glitch, blurry, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, mutated, realism, realistic, impressionism, expressionism, oil, acrylic"
|
||||
Style: Craft clay,"play-doh style {prompt} . sculpture, clay art, centered composition, Claymation","sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
||||
Style: Cinematic,"cinematic film still {prompt} . shallow depth of field, vignette, highly detailed, high budget Hollywood movie, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy","anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured"
|
||||
Style: 3d-model,"professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting","ugly, deformed, noisy, low poly, blurry, painting"
|
||||
Style: pixel art,"pixel-art {prompt} . low-res, blocky, pixel art style, 8-bit graphics","sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic"
|
||||
Style: Texture,"texture {prompt} top down close-up","ugly, deformed, noisy, blurry"
|
||||
>>>>>> SDXL COMFYUI PORT
|
||||
Style: Enhance,"breathtaking {prompt} . award-winning, professional, highly detailed","ugly, deformed, noisy, blurry, distorted, grainy"
|
||||
Style: sai-3d-model,"professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting","ugly, deformed, noisy, low poly, blurry, painting"
|
||||
Style: sai-analog film,"analog film photo {prompt} . faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage","painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured"
|
||||
Style: sai-anime,"anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed","photo, deformed, black and white, realism, disfigured, low contrast"
|
||||
Style: sai-cinematic,"cinematic film still {prompt} . shallow depth of field, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy","anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured"
|
||||
Style: sai-comic book,"comic {prompt} . graphic illustration, comic art, graphic novel art, vibrant, highly detailed","photograph, deformed, glitch, noisy, realistic, stock photo"
|
||||
Style: sai-craft clay,"play-doh style {prompt} . sculpture, clay art, centered composition, Claymation","sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
||||
Style: sai-digital art,"concept art {prompt} . digital artwork, illustrative, painterly, matte painting, highly detailed","photo, photorealistic, realism, ugly"
|
||||
Style: sai-enhance,"breathtaking {prompt} . award-winning, professional, highly detailed","ugly, deformed, noisy, blurry, distorted, grainy"
|
||||
Style: sai-fantasy art,"ethereal fantasy concept art of {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy","photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white"
|
||||
Style: sai-isometric,"isometric style {prompt} . vibrant, beautiful, crisp, detailed, ultra detailed, intricate","deformed, mutated, ugly, disfigured, blur, blurry, noise, noisy, realistic, photographic"
|
||||
Style: sai-line art,"line art drawing {prompt} . professional, sleek, modern, minimalist, graphic, line art, vector graphics","anime, photorealistic, 35mm film, deformed, glitch, blurry, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, mutated, realism, realistic, impressionism, expressionism, oil, acrylic"
|
||||
Style: sai-lowpoly,"low-poly style {prompt} . low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition","noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
||||
Style: sai-neonpunk,"neonpunk style {prompt} . cyberpunk, vaporwave, neon, vibes, vibrant, stunningly beautiful, crisp, detailed, sleek, ultramodern, magenta highlights, dark purple shadows, high contrast, cinematic, ultra detailed, intricate, professional","painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured"
|
||||
Style: sai-origami,"origami style {prompt} . paper art, pleated paper, folded, origami art, pleats, cut and fold, centered composition","noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"
|
||||
Style: sai-photographic,"cinematic photo {prompt} . 35mm photograph, film, bokeh, professional, 4k, highly detailed","drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly"
|
||||
Style: sai-pixel art,"pixel-art {prompt} . low-res, blocky, pixel art style, 8-bit graphics","sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic"
|
||||
Style: sai-texture,"texture {prompt} top down close-up","ugly, deformed, noisy, blurry"
|
||||
Style: ads-advertising,"Advertising poster style {prompt} . Professional, modern, product-focused, commercial, eye-catching, highly detailed","noisy, blurry, amateurish, sloppy, unattractive"
|
||||
Style: ads-automotive,"Automotive advertisement style {prompt} . Sleek, dynamic, professional, commercial, vehicle-focused, high-resolution, highly detailed","noisy, blurry, unattractive, sloppy, unprofessional"
|
||||
Style: ads-corporate,"Corporate branding style {prompt} . Professional, clean, modern, sleek, minimalist, business-oriented, highly detailed","noisy, blurry, grungy, sloppy, cluttered, disorganized"
|
||||
Style: ads-fashion editorial,"Fashion editorial style {prompt} . High fashion, trendy, stylish, editorial, magazine style, professional, highly detailed","outdated, blurry, noisy, unattractive, sloppy"
|
||||
Style: ads-food photography,"Food photography style {prompt} . Appetizing, professional, culinary, high-resolution, commercial, highly detailed","unappetizing, sloppy, unprofessional, noisy, blurry"
|
||||
Style: ads-luxury,"Luxury product style {prompt} . Elegant, sophisticated, high-end, luxurious, professional, highly detailed","cheap, noisy, blurry, unattractive, amateurish"
|
||||
Style: ads-real estate,"Real estate photography style {prompt} . Professional, inviting, well-lit, high-resolution, property-focused, commercial, highly detailed","dark, blurry, unappealing, noisy, unprofessional"
|
||||
Style: ads-retail,"Retail packaging style {prompt} . Vibrant, enticing, commercial, product-focused, eye-catching, professional, highly detailed","noisy, blurry, amateurish, sloppy, unattractive"
|
||||
Style: artstyle-abstract,"abstract style {prompt} . non-representational, colors and shapes, expression of feelings, imaginative, highly detailed","realistic, photographic, figurative, concrete"
|
||||
Style: artstyle-abstract expressionism,"abstract expressionist painting {prompt} . energetic brushwork, bold colors, abstract forms, expressive, emotional","realistic, photorealistic, low contrast, plain, simple, monochrome"
|
||||
Style: artstyle-art deco,"Art Deco style {prompt} . geometric shapes, bold colors, luxurious, elegant, decorative, symmetrical, ornate, detailed","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, modernist, minimalist"
|
||||
Style: artstyle-art nouveau,"Art Nouveau style {prompt} . elegant, decorative, curvilinear forms, nature-inspired, ornate, detailed","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, modernist, minimalist"
|
||||
Style: artstyle-constructivist,"constructivist style {prompt} . geometric shapes, bold colors, dynamic composition, propaganda art style","realistic, photorealistic, low contrast, plain, simple, abstract expressionism"
|
||||
Style: artstyle-cubist,"cubist artwork {prompt} . geometric shapes, abstract, innovative, revolutionary","anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
||||
Style: artstyle-expressionist,"expressionist {prompt} . raw, emotional, dynamic, distortion for emotional effect, vibrant, use of unusual colors, detailed","realism, symmetry, quiet, calm, photo"
|
||||
Style: artstyle-graffiti,"graffiti style {prompt} . street art, vibrant, urban, detailed, tag, mural","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
||||
Style: artstyle-hyperrealism,"hyperrealistic art {prompt} . extremely high-resolution details, photographic, realism pushed to extreme, fine texture, incredibly lifelike","simplified, abstract, unrealistic, impressionistic, low resolution"
|
||||
Style: artstyle-impressionist,"impressionist painting {prompt} . loose brushwork, vibrant color, light and shadow play, captures feeling over form","anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
||||
Style: artstyle-pointillism,"pointillism style {prompt} . composed entirely of small, distinct dots of color, vibrant, highly detailed","line drawing, smooth shading, large color fields, simplistic"
|
||||
Style: artstyle-pop art,"Pop Art style {prompt} . bright colors, bold outlines, popular culture themes, ironic or kitsch","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, minimalist"
|
||||
Style: artstyle-psychedelic,"psychedelic style {prompt} . vibrant colors, swirling patterns, abstract forms, surreal, trippy","monochrome, black and white, low contrast, realistic, photorealistic, plain, simple"
|
||||
Style: artstyle-renaissance,"Renaissance style {prompt} . realistic, perspective, light and shadow, religious or mythological themes, highly detailed","ugly, deformed, noisy, blurry, low contrast, modernist, minimalist, abstract"
|
||||
Style: artstyle-steampunk,"steampunk style {prompt} . antique, mechanical, brass and copper tones, gears, intricate, detailed","deformed, glitch, noisy, low contrast, anime, photorealistic"
|
||||
Style: artstyle-surrealist,"surrealist art {prompt} . dreamlike, mysterious, provocative, symbolic, intricate, detailed","anime, photorealistic, realistic, deformed, glitch, noisy, low contrast"
|
||||
Style: artstyle-typography,"typographic art {prompt} . stylized, intricate, detailed, artistic, text-based","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
||||
Style: artstyle-watercolor,"watercolor painting {prompt} . vibrant, beautiful, painterly, detailed, textural, artistic","anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
||||
Style: futuristic-biomechanical,"biomechanical style {prompt} . blend of organic and mechanical elements, futuristic, cybernetic, detailed, intricate","natural, rustic, primitive, organic, simplistic"
|
||||
Style: futuristic-biomechanical cyberpunk,"biomechanical cyberpunk {prompt} . cybernetics, human-machine fusion, dystopian, organic meets artificial, dark, intricate, highly detailed","natural, colorful, deformed, sketch, low contrast, watercolor"
|
||||
Style: futuristic-cybernetic,"cybernetic style {prompt} . futuristic, technological, cybernetic enhancements, robotics, artificial intelligence themes","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, historical, medieval"
|
||||
Style: futuristic-cybernetic robot,"cybernetic robot {prompt} . android, AI, machine, metal, wires, tech, futuristic, highly detailed","organic, natural, human, sketch, watercolor, low contrast"
|
||||
Style: futuristic-cyberpunk cityscape,"cyberpunk cityscape {prompt} . neon lights, dark alleys, skyscrapers, futuristic, vibrant colors, high contrast, highly detailed","natural, rural, deformed, low contrast, black and white, sketch, watercolor"
|
||||
Style: futuristic-futuristic,"futuristic style {prompt} . sleek, modern, ultramodern, high tech, detailed","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vintage, antique"
|
||||
Style: futuristic-retro cyberpunk,"retro cyberpunk {prompt} . 80's inspired, synthwave, neon, vibrant, detailed, retro futurism","modern, desaturated, black and white, realism, low contrast"
|
||||
Style: futuristic-retro futurism,"retro-futuristic {prompt} . vintage sci-fi, 50s and 60s style, atomic age, vibrant, highly detailed","contemporary, realistic, rustic, primitive"
|
||||
Style: futuristic-sci-fi,"sci-fi style {prompt} . futuristic, technological, alien worlds, space themes, advanced civilizations","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, historical, medieval"
|
||||
Style: futuristic-vaporwave,"vaporwave style {prompt} . retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed","monochrome, muted colors, realism, rustic, minimalist, dark"
|
||||
Style: game-bubble bobble,"Bubble Bobble style {prompt} . 8-bit, cute, pixelated, fantasy, vibrant, reminiscent of Bubble Bobble game","realistic, modern, photorealistic, violent, horror"
|
||||
Style: game-cyberpunk game,"cyberpunk game style {prompt} . neon, dystopian, futuristic, digital, vibrant, detailed, high contrast, reminiscent of cyberpunk genre video games","historical, natural, rustic, low detailed"
|
||||
Style: game-fighting game,"fighting game style {prompt} . dynamic, vibrant, action-packed, detailed character design, reminiscent of fighting video games","peaceful, calm, minimalist, photorealistic"
|
||||
Style: game-gta,"GTA-style artwork {prompt} . satirical, exaggerated, pop art style, vibrant colors, iconic characters, action-packed","realistic, black and white, low contrast, impressionist, cubist, noisy, blurry, deformed"
|
||||
Style: game-mario,"Super Mario style {prompt} . vibrant, cute, cartoony, fantasy, playful, reminiscent of Super Mario series","realistic, modern, horror, dystopian, violent"
|
||||
Style: game-minecraft,"Minecraft style {prompt} . blocky, pixelated, vibrant colors, recognizable characters and objects, game assets","smooth, realistic, detailed, photorealistic, noise, blurry, deformed"
|
||||
Style: game-pokemon,"Pokémon style {prompt} . vibrant, cute, anime, fantasy, reminiscent of Pokémon series","realistic, modern, horror, dystopian, violent"
|
||||
Style: game-retro arcade,"retro arcade style {prompt} . 8-bit, pixelated, vibrant, classic video game, old school gaming, reminiscent of 80s and 90s arcade games","modern, ultra-high resolution, photorealistic, 3D"
|
||||
Style: game-retro game,"retro game art {prompt} . 16-bit, vibrant colors, pixelated, nostalgic, charming, fun","realistic, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"
|
||||
Style: game-rpg fantasy game,"role-playing game (RPG) style fantasy {prompt} . detailed, vibrant, immersive, reminiscent of high fantasy RPG games","sci-fi, modern, urban, futuristic, low detailed"
|
||||
Style: game-strategy game,"strategy game style {prompt} . overhead view, detailed map, units, reminiscent of real-time strategy video games","first-person view, modern, photorealistic"
|
||||
Style: game-streetfighter,"Street Fighter style {prompt} . vibrant, dynamic, arcade, 2D fighting game, highly detailed, reminiscent of Street Fighter series","3D, realistic, modern, photorealistic, turn-based strategy"
|
||||
Style: game-zelda,"Legend of Zelda style {prompt} . vibrant, fantasy, detailed, epic, heroic, reminiscent of The Legend of Zelda series","sci-fi, modern, realistic, horror"
|
||||
Style: misc-architectural,"architectural style {prompt} . clean lines, geometric shapes, minimalist, modern, architectural drawing, highly detailed","curved lines, ornate, baroque, abstract, grunge"
|
||||
Style: misc-disco,"disco-themed {prompt} . vibrant, groovy, retro 70s style, shiny disco balls, neon lights, dance floor, highly detailed","minimalist, rustic, monochrome, contemporary, simplistic"
|
||||
Style: misc-dreamscape,"dreamscape {prompt} . surreal, ethereal, dreamy, mysterious, fantasy, highly detailed","realistic, concrete, ordinary, mundane"
|
||||
Style: misc-dystopian,"dystopian style {prompt} . bleak, post-apocalyptic, somber, dramatic, highly detailed","ugly, deformed, noisy, blurry, low contrast, cheerful, optimistic, vibrant, colorful"
|
||||
Style: misc-fairy tale,"fairy tale {prompt} . magical, fantastical, enchanting, storybook style, highly detailed","realistic, modern, ordinary, mundane"
|
||||
Style: misc-gothic,"gothic style {prompt} . dark, mysterious, haunting, dramatic, ornate, detailed","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, cheerful, optimistic"
|
||||
Style: misc-grunge,"grunge style {prompt} . textured, distressed, vintage, edgy, punk rock vibe, dirty, noisy","smooth, clean, minimalist, sleek, modern, photorealistic"
|
||||
Style: misc-horror,"horror-themed {prompt} . eerie, unsettling, dark, spooky, suspenseful, grim, highly detailed","cheerful, bright, vibrant, light-hearted, cute"
|
||||
Style: misc-kawaii,"kawaii style {prompt} . cute, adorable, brightly colored, cheerful, anime influence, highly detailed","dark, scary, realistic, monochrome, abstract"
|
||||
Style: misc-lovecraftian,"lovecraftian horror {prompt} . eldritch, cosmic horror, unknown, mysterious, surreal, highly detailed","light-hearted, mundane, familiar, simplistic, realistic"
|
||||
Style: misc-macabre,"macabre style {prompt} . dark, gothic, grim, haunting, highly detailed","bright, cheerful, light-hearted, cartoonish, cute"
|
||||
Style: misc-manga,"manga style {prompt} . vibrant, high-energy, detailed, iconic, Japanese comic style","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style"
|
||||
Style: misc-metropolis,"metropolis-themed {prompt} . urban, cityscape, skyscrapers, modern, futuristic, highly detailed","rural, natural, rustic, historical, simple"
|
||||
Style: misc-minimalist,"minimalist style {prompt} . simple, clean, uncluttered, modern, elegant","ornate, complicated, highly detailed, cluttered, disordered, messy, noisy"
|
||||
Style: misc-monochrome,"monochrome {prompt} . black and white, contrast, tone, texture, detailed","colorful, vibrant, noisy, blurry, deformed"
|
||||
Style: misc-nautical,"nautical-themed {prompt} . sea, ocean, ships, maritime, beach, marine life, highly detailed","landlocked, desert, mountains, urban, rustic"
|
||||
Style: misc-space,"space-themed {prompt} . cosmic, celestial, stars, galaxies, nebulas, planets, science fiction, highly detailed","earthly, mundane, ground-based, realism"
|
||||
Style: misc-stained glass,"stained glass style {prompt} . vibrant, beautiful, translucent, intricate, detailed","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
||||
Style: misc-techwear fashion,"techwear fashion {prompt} . futuristic, cyberpunk, urban, tactical, sleek, dark, highly detailed","vintage, rural, colorful, low contrast, realism, sketch, watercolor"
|
||||
Style: misc-tribal,"tribal style {prompt} . indigenous, ethnic, traditional patterns, bold, natural colors, highly detailed","modern, futuristic, minimalist, pastel"
|
||||
Style: misc-zentangle,"zentangle {prompt} . intricate, abstract, monochrome, patterns, meditative, highly detailed","colorful, representative, simplistic, large fields of color"
|
||||
Style: papercraft-collage,"collage style {prompt} . mixed media, layered, textural, detailed, artistic","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"
|
||||
Style: papercraft-flat papercut,"flat papercut style {prompt} . silhouette, clean cuts, paper, sharp edges, minimalist, color block","3D, high detail, noise, grainy, blurry, painting, drawing, photo, disfigured"
|
||||
Style: papercraft-kirigami,"kirigami representation of {prompt} . 3D, paper folding, paper cutting, Japanese, intricate, symmetrical, precision, clean lines","painting, drawing, 2D, noisy, blurry, deformed"
|
||||
Style: papercraft-paper mache,"paper mache representation of {prompt} . 3D, sculptural, textured, handmade, vibrant, fun","2D, flat, photo, sketch, digital art, deformed, noisy, blurry"
|
||||
Style: papercraft-paper quilling,"paper quilling art of {prompt} . intricate, delicate, curling, rolling, shaping, coiling, loops, 3D, dimensional, ornamental","photo, painting, drawing, 2D, flat, deformed, noisy, blurry"
|
||||
Style: papercraft-papercut collage,"papercut collage of {prompt} . mixed media, textured paper, overlapping, asymmetrical, abstract, vibrant","photo, 3D, realistic, drawing, painting, high detail, disfigured"
|
||||
Style: papercraft-papercut shadow box,"3D papercut shadow box of {prompt} . layered, dimensional, depth, silhouette, shadow, papercut, handmade, high contrast","painting, drawing, photo, 2D, flat, high detail, blurry, noisy, disfigured"
|
||||
Style: papercraft-stacked papercut,"stacked papercut art of {prompt} . 3D, layered, dimensional, depth, precision cut, stacked layers, papercut, high contrast","2D, flat, noisy, blurry, painting, drawing, photo, deformed"
|
||||
Style: papercraft-thick layered papercut,"thick layered papercut art of {prompt} . deep 3D, volumetric, dimensional, depth, thick paper, high stack, heavy texture, tangible layers","2D, flat, thin paper, low stack, smooth texture, painting, drawing, photo, deformed"
|
||||
Style: photo-alien,"alien-themed {prompt} . extraterrestrial, cosmic, otherworldly, mysterious, sci-fi, highly detailed","earthly, mundane, common, realistic, simple"
|
||||
Style: photo-film noir,"film noir style {prompt} . monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vibrant, colorful"
|
||||
Style: photo-hdr,"HDR photo of {prompt} . High dynamic range, vivid, rich details, clear shadows and highlights, realistic, intense, enhanced contrast, highly detailed","flat, low contrast, oversaturated, underexposed, overexposed, blurred, noisy"
|
||||
Style: photo-long exposure,"long exposure photo of {prompt} . Blurred motion, streaks of light, surreal, dreamy, ghosting effect, highly detailed","static, noisy, deformed, shaky, abrupt, flat, low contrast"
|
||||
Style: photo-neon noir,"neon noir {prompt} . cyberpunk, dark, rainy streets, neon signs, high contrast, low light, vibrant, highly detailed","bright, sunny, daytime, low contrast, black and white, sketch, watercolor"
|
||||
Style: photo-silhouette,"silhouette style {prompt} . high contrast, minimalistic, black and white, stark, dramatic","ugly, deformed, noisy, blurry, low contrast, color, realism, photorealistic"
|
||||
Style: photo-tilt-shift,"tilt-shift photo of {prompt} . Selective focus, miniature effect, blurred background, highly detailed, vibrant, perspective control","blurry, noisy, deformed, flat, low contrast, unrealistic, oversaturated, underexposed"
|
||||
>>>>>> Advanced GPT Styles
|
||||
Style: Space art,"galactic style {prompt} . nebula, constellation, cosmic, celestial, highly detailed, starry","blurry, grainy, deformed, photo-realistic, low-contrast, terrestrial"
|
||||
Style: Street art,"urban graffiti style {prompt} . vibrant, edgy, street art, underground, spray paint effect","clean, minimalistic, soft, gentle, blurry, off-center"
|
||||
Style: Baroque,"Baroque art {prompt} . ornate, richly detailed, dramatic, high contrast, complex composition","minimalistic, low-contrast, blurry, deformed, modern, abstract"
|
||||
Style: Abstract,"abstract {prompt} . imaginative, surreal, non-representational, dream-like","realistic, photo, literal, symmetrical, rigid"
|
||||
Style: Pointillism,"pointillism art {prompt} . dots, dappled, stipples, highly detailed","smooth, blurry, photo-realistic, non-dotted"
|
||||
Style: Impressionist,"impressionist painting {prompt} . soft edges, vibrant, loose brushwork, atmospheric, highly detailed","hard edges, muted colors, tight brushwork, non-atmospheric"
|
||||
Style: Pop art,"pop art {prompt} . vibrant, mass culture, comic style, bold lines, ironic","soft, elegant, high culture, realistic, subtle lines"
|
||||
Style: Minimalist,"minimalist design {prompt} . clean, simple, restrained, elegant","busy, complex, flamboyant, disfigured"
|
||||
Style: Art Deco,"art deco {prompt} . opulent, lavish, ornate, symmetrical, geometric","minimalistic, simple, asymmetrical, organic"
|
||||
Style: Cubist,"cubist {prompt} . abstract, geometric, fragmented, multiple perspectives","realistic, smooth, unbroken, single perspective"
|
||||
Style: Dada,"dada style {prompt} . absurd, satirical, avant-garde, abstract","serious, traditional, conventional, realistic"
|
||||
Style: Victorian,"Victorian style {prompt} . elegant, ornate, highly detailed, historical","modern, minimalist, low detail, contemporary"
|
||||
Style: Art Nouveau,"art nouveau {prompt} . organic, curvilinear, decorative, highly detailed","geometric, straight lines, functional, low detail"
|
||||
Style: Futuristic,"futuristic {prompt} . advanced, high-tech, sleek, modern","old, low-tech, chunky, historical"
|
||||
Style: Medieval,"medieval style {prompt} . historical, ornate, religious, gothic","modern, simple, secular, minimalist"
|
||||
Style: Industrial,"industrial style {prompt} . mechanical, robust, urban, gritty","natural, fragile, rural, clean"
|
||||
Style: Vaporwave,"vaporwave style {prompt} . retro, neon, pixelated, nostalgic","modern, monochrome, high-resolution, forward-looking"
|
||||
Style: Horror,"horror style {prompt} . dark, eerie, gothic, macabre","light, cheerful, minimalist, happy"
|
||||
Style: Gothic,"gothic style {prompt} . dark, mysterious, intricate, moody","light, cheerful, simple, vibrant"
|
||||
Style: Steampunk,"steampunk style {prompt} . retro, mechanical, detailed, Victorian","modern, digital, minimalist, contemporary"
|
||||
Style: Retro,"retro style {prompt} . vintage, nostalgic, old-fashioned, highly detailed","modern, futuristic, forward-looking, low detail"
|
||||
Style: Surrealist,"surrealist {prompt} . dream-like, bizarre, irrational, highly detailed","realistic, mundane, rational, low detail"
|
||||
Style: Realism,"realism style {prompt} . lifelike, detailed, accurate, representational","abstract, simplistic, inaccurate, non-representational"
|
||||
Style: Silhouette,"silhouette style {prompt} . minimalist, monochrome, stark, high contrast","detailed, multicolored, soft, low contrast"
|
||||
Style: Collage,"collage style {prompt} . mixed media, assembled, eclectic, highly detailed","uniform, unvarying, minimalist, low detail"
|
||||
Style: Watercolor,"watercolor {prompt} . soft, blended, transparent, fluid","hard, unblended, opaque, rigid"
|
||||
Style: Calligraphy,"calligraphy {prompt} . elegant, flowing, ornate, highly detailed","plain, rigid, simple, low detail"
|
||||
Style: Expressionist,"expressionist style {prompt} . emotional, intense, vibrant, highly detailed","emotionless, calm, muted, low detail"
|
||||
Style: Fauvist,"fauvist style {prompt} . bold color, exaggerated, expressive, highly detailed","neutral color, realistic, restrained, low detail"
|
||||
Style: Renaissance,"Renaissance style {prompt} . classical, humanistic, realistic, highly detailed","modern, abstract, unrealistic, low detail"
|
||||
Style: Photorealistic,"photorealistic {prompt} . highly detailed, lifelike, precise, accurate","abstract, low detail, unrealistic, inaccurate"
|
||||
Style: Symbolic,"symbolic style {prompt} . conceptual, representative, allegorical, highly detailed","literal, non-representative, factual, low detail"
|
||||
Style: Avant-garde,"avant-garde style {prompt} . experimental, innovative, non-traditional","traditional, conventional, classic"
|
||||
Style: Mosaic,"mosaic style {prompt} . fragmented, assembled, colorful, highly detailed","whole, unbroken, monochrome, low detail"
|
||||
Style: Trompe l'oeil,"trompe l'oeil style {prompt} . deceptive, 3D effect, realistic, highly detailed","honest, 2D effect, unrealistic, low detail"
|
||||
Style: Rococo,"rococo style {prompt} . ornate, playful, romantic, pastel, highly detailed","minimalistic, serious, unromantic, dark, low detail"
|
||||
Style: Macabre,"macabre style {prompt} . dark, eerie, grotesque, highly detailed","light, cheerful, beautiful, low detail"
|
||||
Style: Satirical,"satirical style {prompt} . humorous, ironic, exaggerated, critical","serious, literal, realistic, complimentary"
|
||||
Style: Pixelated,"pixelated style {prompt} . retro, low-res, digital, blocky","modern, high-res, organic, smooth"
|
||||
Style: Futurist,"futurist style {prompt} . dynamic, modern, mechanized, highly detailed","static, historical, organic, low detail"
|
||||
Style: Primitive,"primitive style {prompt} . raw, simple, naive, highly detailed","refined, complex, sophisticated, low detail"
|
||||
Style: Byzantine,"Byzantine style {prompt} . rich, ornate, religious, iconic, highly detailed","poor, simple, secular, non-iconic, low detail"
|
||||
Style: Psychedelic,"psychedelic style {prompt} . vibrant, abstract, distorted, highly detailed","muted, realistic, undistorted, low detail"
|
||||
Style: Suprematist,"suprematist style {prompt} . geometric, abstract, non-objective, simple","organic, realistic, objective, complex"
|
||||
Style: Constructivist,"constructivist style {prompt} . industrial, geometric, political, highly detailed","organic, curvilinear, apolitical, low detail"
|
||||
Style: De Stijl,"de Stijl style {prompt} . abstract, geometric, primary colors,"organic, curvilinear, muted colors, black and white"
|
||||
Style: Ukiyo-e,"ukiyo-e style {prompt} . woodblock print, vibrant, historical Japanese art, detailed","digital, muted, modern, Western"
|
||||
Style: Dystopian,"dystopian style {prompt} . bleak, oppressive, futuristic, detailed","utopian, cheerful, historical, low detail"
|
||||
Style: Biomechanical,"biomechanical style {prompt} . organic meets mechanical, alien, detailed, H.R. Giger-inspired","geometric, earthy, low detail, not H.R. Giger-inspired"
|
||||
Style: Hyperrealism,"hyperrealistic style {prompt} . ultra-detailed, lifelike, precision, crisp","abstract, low detail, unrealistic, blurry"
|
||||
Style: Glitch,"glitch style {prompt} . digital error, distorted, cyber, detailed","analog, undistorted, organic, low detail"
|
||||
Style: Trompe-l'oeil,"trompe-l'oeil style {prompt} . optical illusion, lifelike, 3D effect, detailed","flat, 2D effect, unrealistic, low detail"
|
||||
Style: Arabesque,"arabesque style {prompt} . geometric patterns, floral, Islamic art, detailed","chaotic, animalistic, non-Islamic art, low detail"
|
||||
Style: Brutalist,"brutalist style {prompt} . raw, rugged, geometric, concrete, detailed","smooth, delicate, curvilinear, abstract, low detail"
|
||||
Style: Chiaroscuro,"chiaroscuro style {prompt} . high contrast, dramatic lighting, detailed","low contrast, flat lighting, low detail"
|
||||
Style: Tenebrism,"tenebrism style {prompt} . dark, dramatic illumination, high contrast, detailed","light, flat lighting, low contrast, low detail"
|
||||
Style: Romantic,"romantic style {prompt} . emotional, dramatic, nature-focused, detailed","unemotional, flat, city-focused, low detail"
|
||||
Style: Bauhaus,"bauhaus style {prompt} . functional, geometric, minimal, detailed","ornamental, curvilinear, maximal, low detail"
|
||||
Style: Art brut,"art brut style {prompt} . raw, outsider art, naïve, detailed","refined, mainstream art, sophisticated, low detail"
|
||||
Style: Metaphysical,"metaphysical style {prompt} . surreal, eerie, uncanny, detailed","realistic, comfortable, familiar, low detail"
|
||||
Style: Neoplasticism,"neoplasticism style {prompt} . geometric, primary colors, black and white, abstract","organic, muted colors, colorful, realistic"
|
||||
Style: Hard-edge,"hard-edge style {prompt} . geometric, flat colors, precision, detailed","organic, gradient colors, imprecise, low detail"
|
||||
Style: Automatism,"automatism style {prompt} . unconscious, spontaneous, abstract, detailed","conscious, planned, realistic, low detail"
|
||||
Style: Tachisme,"tachisme style {prompt} . gestural, abstract, spontaneous, detailed","controlled, realistic, planned, low detail"
|
||||
Style: Lyrical abstraction,"lyrical abstraction style {prompt} . emotional, non-figurative, expressive, detailed","unemotional, figurative, restrained, low detail"
|
||||
Style: Color field,"color field style {prompt} . flat, large fields of color, minimal, detailed","textured, small patches of color, maximal, low detail"
|
||||
Style: Synthetism,"synthetism style {prompt} . simplified, symbolic, bright colors, detailed","complex, literal, muted colors, low detail"
|
||||
Style: Cloisonnism,"cloisonnism style {prompt} . bold outlines, flat colors, decorative, detailed","soft outlines, gradient colors, functional, low detail"
|
||||
Style: Assemblage,"assemblage style {prompt} . three-dimensional, found objects, eclectic, detailed","two-dimensional, traditional materials, uniform, low detail"
|
||||
Style: Vorticism,"vorticism style {prompt} . geometric, abstract, dynamic, detailed","organic, realistic, static, low detail"
|
||||
Style: Op art,"op art style {prompt} . optical illusions, geometric, black and white, detailed","no illusions, organic, colorful, low detail"
|
||||
Style: Divisionism,"divisionism style {prompt} . color theory, dot technique, vibrant, detailed","black and white, smooth technique, muted, low detail"
|
||||
Style: Kinetic art,"kinetic art style {prompt} . movement, dynamic, interactive, detailed","static, static, non-interactive, low detail"
|
||||
Style: Orphism,"orphism style {prompt} . pure color, abstract, musical, detailed","mixed color, realistic, non-musical, low detail"
|
||||
Style: Suprematism,"suprematism style {prompt} . geometric, abstract, limited color palette, detailed","organic, realistic, broad color palette, low detail"
|
||||
Style: Letterism,"letterism style {prompt} . letters, typographic, abstract, detailed","images, non-typographic, realistic, low detail"
|
||||
Style: Situationalist,"situationalist style {prompt} . political, collage, detournement, detailed","apolitical, single medium, straightforward, low detail"
|
||||
Style: Sound art,"sound art style {prompt} . auditory, abstract, non-visual, detailed","visual, realistic, silent, low detail"
|
||||
Style: Land art,"land art style {prompt} . natural materials, outdoor, environmental, detailed","synthetic materials, indoor, non-environmental, low detail"
|
||||
Style: Photorealistic graffiti,"photorealistic graffiti style {prompt} . urban, street art, lifelike, detailed","rural, gallery art, abstract, low detail"
|
||||
Style: Hypermodern,"hypermodern style {prompt} . postmodern, technology focused, sleek, detailed","premodern, nature focused, rustic, low detail"
|
||||
Style: Virtual realism,"virtual realism style {prompt} . digital, lifelike, immersive, detailed","analog, abstract, non-immersive, low detail"
|
||||
Style: Structural film,"structural film style {prompt} . experimental, non-narrative, texture, detailed","traditional, narrative, smooth, low detail"
|
||||
Style: Process art,"process art style {prompt} . creation focused, ephemeral, documentation, detailed","result focused, permanent, no documentation, low detail"
|
||||
Style: Light and space,"light and space style {prompt} . perceptual phenomena, immersive, minimal, detailed","solid objects, non-immersive, maximal, low detail"
|
||||
Style: Post-internet,"post-internet style {prompt} . digital culture, technology, online, detailed","pre-internet, nature, offline, low detail"
|
||||
Style: Bio-art,"bio-art style {prompt} . living organisms, ethical, natural, detailed","inorganic, unethical, synthetic, low detail"
|
||||
>>>>>> GPT Cultural Styles
|
||||
Style: Byzantine,"Byzantine style {prompt} . religious, iconography, gold, highly detailed, mosaics","secular, simple, bronze, minimalist, paintings"
|
||||
Style: Celtic,"Celtic style {prompt} . geometric patterns, intricate knots, medieval, highly detailed","random, simplistic, modern, undetailed"
|
||||
Style: Native American,"Native American style {prompt} . traditional patterns, tribal, cultural symbols, highly detailed","modern, non-tribal, abstract, undetailed"
|
||||
Style: Aboriginal,"Aboriginal style {prompt} . dot painting, Dreamtime stories, Australian culture, highly detailed","non-Australian, line drawing, abstract, undetailed"
|
||||
Style: Egyptian,"Egyptian style {prompt} . hieroglyphs, gods and goddesses, Pharaohs, highly detailed","non-Egyptian, text-free, secular, undetailed"
|
||||
Style: Mayan,"Mayan style {prompt} . glyphs, ancient civilization, detailed carvings, highly detailed","modern, non-Mayan, simplistic, undetailed"
|
||||
Style: Renaissance,"Renaissance style {prompt} . humanism, realism, perspective, highly detailed","abstract, surreal, flat, undetailed"
|
||||
Style: Mughal,"Mughal style {prompt} . Indian and Persian influence, miniature paintings, highly detailed","non-Indian, non-Persian, large-scale, undetailed"
|
||||
Style: Romanesque,"Romanesque style {prompt} . medieval, religious, thick walls, highly detailed","modern, secular, transparent, undetailed"
|
||||
Style: Gothic,"Gothic style {prompt} . medieval, pointed arches, stained glass, highly detailed","modern, round arches, clear glass, undetailed"
|
||||
Style: Baroque,"Baroque style {prompt} . grandeur, drama, chiaroscuro, highly detailed","minimalist, calm, flat, undetailed"
|
||||
Style: Rococo,"Rococo style {prompt} . ornate, pastel, love and nature themes, highly detailed","simple, dark, abstract, undetailed"
|
||||
Style: Pre-Raphaelite,"Pre-Raphaelite style {prompt} . romantic, vivid color, medieval subjects, highly detailed","realistic, muted color, modern subjects, undetailed"
|
||||
Style: Impressionist,"Impressionist style {prompt} . loose brushwork, light and color, ordinary subjects, highly detailed","tight brushwork, black and white, extraordinary subjects, undetailed"
|
||||
Style: Cubist,"Cubist style {prompt} . geometric, multi-perspective, fragmented, highly detailed","organic, single perspective, whole, undetailed"
|
||||
Style: Surrealist,"Surrealist style {prompt} . dreamlike, irrational, unexpected juxtapositions, highly detailed","realistic, rational, expected combinations, undetailed"
|
||||
Style: Futurist,"Futurist style {prompt} . dynamic, technology, speed, highly detailed","static, nature, slow, undetailed"
|
||||
Style: Dada,"Dada style {prompt} . absurd, anti-art, randomness, highly detailed","rational, pro-art, order, undetailed"
|
||||
Style: Expressionist,"Expressionist style {prompt} . emotional, distorted, individual perspective, highly detailed","unemotional, realistic, collective perspective, undetailed"
|
||||
Style: Fauvist,"Fauvist style {prompt} . bold color, wild brushwork, simplification, highly detailed","muted color, careful brushwork, detail, undetailed"
|
||||
Style: Socialist Realist,"Socialist Realist style {prompt} . idealized, political, proletarian, highly detailed","realistic, apolitical, bourgeois, undetailed"
|
||||
Style: Pop Art,"Pop Art style {prompt} . popular culture, advertising, bold, highly detailed","high art, non-commercial, muted, undetailed"
|
||||
Style: Suprematism,"Suprematism style {prompt} . geometric, non-objective, primary colors, highly detailed","organic, objective, pastel colors, undetailed"
|
||||
Style: Symbolist,"Symbolist style {prompt} . mythical, dreamy, spiritual, highly detailed","realistic, practical, secular, undetailed"
|
||||
Style: Pre-Columbian,"Pre-Columbian style {prompt} . ancient Americas, native, cultural, highly detailed","modern, non-American, abstract, undetailed"
|
||||
Style: Constructivist,"Constructivist style {prompt} . industrial, geometric, socialist, highly detailed","organic, round, capitalist, undetailed"
|
||||
Style: Art Nouveau,"Art Nouveau style {prompt} . decorative, nature-inspired, curved lines, highly detailed","functional, geometric, straight lines, undetailed"
|
||||
Style: Precisionist,"Precisionist style {prompt} . industrial, crisp, geometric, highly detailed","organic, blurry, round, undetailed"
|
||||
Style: Neoclassical,"Neoclassical style {prompt} . ancient Rome and Greece, rational, heroic, highly detailed","modern, emotional, ordinary, undetailed"
|
||||
Style: Persian Miniature,"Persian Miniature style {prompt} . Middle Eastern, intricate, storytelling, highly detailed","Western, simple, non-narrative, undetailed"
|
||||
Style: Edo,"Edo style {prompt} . Japanese, woodblock prints, floating world, highly detailed","non-Japanese, oil painting, real world, undetailed"
|
||||
Style: Tribal,"Tribal style {prompt} . African, indigenous, symbolic, highly detailed","non-African, mainstream, abstract, undetailed"
|
||||
Style: Tibetan Thangka,"Tibetan Thangka style {prompt} . spiritual, Buddhist, meditation, highly detailed","secular, non-Buddhist, disturbing, undetailed"
|
||||
Style: Art Deco,"Art Deco style {prompt} . modern, geometric, luxury, highly detailed","vintage, organic, minimalism, undetailed"
|
||||
Style: Minimalist,"Minimalist style {prompt} . simple, functional, unadorned, highly detailed","complex, decorative, adorned, undetailed"
|
||||
Style: Greek Classical,"Greek Classical style {prompt} . ancient, mythology, balanced, highly detailed","modern, everyday life, unbalanced, undetailed"
|
||||
Style: African,"African style {prompt} . tribal, symbolic, cultural, highly detailed","non-African, abstract, non-cultural, undetailed"
|
||||
Style: Russian Iconography,"Russian Iconography style {prompt} . religious, orthodox, gold, highly detailed","secular, non-orthodox, silver, undetailed"
|
||||
Style: Nordic,"Nordic style {prompt} . Scandinavian, minimal, nature, highly detailed","non-Scandinavian, maximal, urban, undetailed"
|
||||
Style: Inuit,"Inuit style {prompt} . Arctic, native, animal themes, highly detailed","tropical, non-native, human themes, undetailed"
|
||||
Style: Maori,"Maori style {prompt} . New Zealand, tribal, spiritual, highly detailed","non-New Zealand, non-tribal, secular, undetailed"
|
||||
Style: Iznik,"Iznik style {prompt} . Turkish, ceramic, floral, highly detailed","non-Turkish, canvas, geometric, undetailed"
|
||||
Style: Ottoman,"Ottoman style {prompt} . Islamic, calligraphy, miniatures, highly detailed","non-Islamic, typography, large-scale, undetailed"
|
||||
Style: Hanami,"Hanami style {prompt} . Japanese, cherry blossoms,spring, highly detailed","non-Japanese, winter, abstract, undetailed"
|
||||
Style: Mandala,"Mandala style {prompt} . spiritual, geometric, symmetrical, highly detailed","secular, organic, asymmetrical, undetailed"
|
||||
Style: Aztec,"Aztec style {prompt} . ancient Mexico, symbolic, cultural, highly detailed","modern, abstract, non-cultural, undetailed"
|
||||
Style: Sumi-e,"Sumi-e style {prompt} . Japanese ink painting, minimal, nature, highly detailed","non-Japanese, colorful, urban, undetailed"
|
||||
Style: Ukiyo-e,"Ukiyo-e style {prompt} . Japanese, woodblock prints, floating world, highly detailed","non-Japanese, digital art, real world, undetailed"
|
||||
Style: Haida,"Haida style {prompt} . Native American, form line, nature, highly detailed","non-Native American, abstract, urban, undetailed"
|
||||
Style: Moorish,"Moorish style {prompt} . Islamic, geometric, Andalusian, highly detailed","non-Islamic, organic, non-Andalusian, undetailed"
|
||||
Style: Victorian,"Victorian style {prompt} . 19th century, ornate, romantic, highly detailed","21st century, minimal, unemotional, undetailed"
|
||||
Style: Pueblo,"Pueblo style {prompt} . Native American, traditional, pottery, highly detailed","non-Native American, modern, photography, undetailed"
|
||||
Style: Cloisonné,"Cloisonné style {prompt} . metalwork, enamel, intricate, highly detailed","woodwork, paint, simple, undetailed"
|
||||
Style: Khokhloma,"Khokhloma style {prompt} . Russian, folk art, floral, highly detailed","non-Russian, fine art, geometric, undetailed"
|
||||
Style: Biedermeier,"Biedermeier style {prompt} . 19th century, domestic, unpretentious, highly detailed","21st century, public, pretentious, undetailed"
|
||||
Style: Goryeo,"Goryeo style {prompt} . Korean, celadon, inlay, highly detailed","non-Korean, terra cotta, relief, undetailed"
|
||||
Style: Han,"Han style {prompt} . Chinese, ancient, stone relief, highly detailed","non-Chinese, modern, oil painting, undetailed"
|
||||
Style: Hellenistic,"Hellenistic style {prompt} . ancient Greek, dynamic, emotional, highly detailed","modern, static, unemotional, undetailed"
|
||||
Style: Tang,"Tang style {prompt} . Chinese, ancient, sculpture, highly detailed","non-Chinese, modern, photography, undetailed"
|
||||
Style: Ming,"Ming style {prompt} . Chinese, elegant, pottery, highly detailed","non-Chinese, rustic, painting, undetailed"
|
||||
Style: Joseon,"Joseon style {prompt} . Korean, Confucian, painting, highly detailed","non-Korean, Taoist, sculpture, undetailed"
|
||||
Style: Gupta,"Gupta style {prompt} . Indian, ancient, sculpture, highly detailed","non-Indian, modern, painting, undetailed"
|
||||
Style: Pallava,"Pallava style {prompt} . Indian, Dravidian architecture, sculpture, highly detailed","non-Indian, Mughal architecture, painting, undetailed"
|
||||
Style: Chola,"Chola style {prompt} . Indian, bronze, dancing Shiva, highly detailed","non-Indian, marble, sitting Buddha, undetailed"
|
||||
Style: Minoan,"Minoan style {prompt} . ancient Crete, frescoes, sea life, highly detailed","modern, oil painting, land animals, undetailed"
|
||||
Style: Mycenaean,"Mycenaean style {prompt} . ancient Greece, gold, death mask, highly detailed","modern, bronze, life mask, undetailed"
|
||||
Style: Ndebele,"Ndebele style {prompt} . African, geometric, house painting, highly detailed","non-African, organic, canvas painting, undetailed"
|
||||
Style: San,"San style {prompt} . African, rock art, animal figures, highly detailed","non-African, digital art, human figures, undetailed"
|
||||
Style: Batik,"Batik style {prompt} . Indonesian, resist dyeing, floral, highly detailed","non-Indonesian, direct dyeing, geometric, undetailed"
|
||||
Style: Assyrian,"Assyrian style {prompt} . ancient Mesopotamia, relief, war scenes, highly detailed","modern, oil painting, peaceful scenes, undetailed"
|
||||
Style: Thracian,"Thracian style {prompt} . ancient Balkans, gold, ritual objects, highly detailed","modern, wood, everyday objects, undetailed"
|
||||
Style: Etruscan,"Etruscan style {prompt} . ancient Italy, bronze, mythological scenes, highly detailed","modern, steel, realistic scenes, undetailed"
|
||||
Style: Sumerian,"Sumerian style {prompt} . ancient Mesopotamia, cuneiform, clay tablets, highly detailed","modern, Latin script, parchment scrolls, undetailed"
|
||||
Style: Babylonian,"Babylonian style {prompt} . ancient Mesopotamia, law codes, stone steles, highly detailed","modern, lawless, paper books, undetailed"
|
||||
Style: Norse,"Norse style {prompt} . Viking, runic, wood carving, highly detailed","non-Viking, Latin script, metalwork, undetailed"
|
||||
Style: Olmec,"Olmec style {prompt} . ancient Mexico, colossal heads, basalt, highly detailed","modern, miniature hands, marble, undetailed"
|
||||
Style: Toltec,"Toltec style {prompt} . ancient Mexico, monumental architecture, relief, highly detailed","modern, small-scale models, oil painting, undetailed"
|
||||
Style: Sicán,"Sicán style {prompt} . ancient Peru, gold masks, funerary objects, highly detailed","modern, wood masks, everyday objects, undetailed"
|
||||
Style: Nazca,"Nazca style {prompt} . ancient Peru, geoglyphs, desert, highly detailed","modern, graffiti, urban, undetailed"
|
||||
Style: Inca,"Inca style {prompt} . ancient Peru, stonework, terraces, highly detailed","modern, woodwork, flat plains, undetailed"
|
||||
Style: Zapotec,"Zapotec style {prompt} . ancient Mexico, urns, jaguars, highly detailed","modern, vases, dogs, undetailed"
|
||||
Style: Mixtec,"Mixtec style {prompt} . ancient Mexico, codices, turquoise, highly detailed","modern, novels, gold, undetailed"
|
||||
Style: Ottonian,"Ottonian style {prompt} . medieval Germany, religious art, manuscripts, highly detailed","modern, secular art, newspapers, undetailed"
|
||||
Style: Merovingian,"Merovingian style {prompt} . medieval France, jewelry, garnet cloisonné, highly detailed","modern, clothing, sapphire pavé, undetailed"
|
||||
Style: Carolingian,"Carolingian style {prompt} . medieval Europe, illuminatedmanuscripts, luxury, highly detailed","modern, paperback books, simplicity, undetailed"
|
||||
Style: Otomi,"Otomi style {prompt} . Mexican, textile, embroidery, highly detailed","non-Mexican, metalwork, hammering, undetailed"
|
||||
Style: Huichol,"Huichol style {prompt} . Mexican, yarn painting, spiritual, highly detailed","non-Mexican, oil painting, secular, undetailed"
|
||||
Style: Ainu,"Ainu style {prompt} . Japanese indigenous, wood carving, bear worship, highly detailed","non-Japanese, stone carving, dragon worship, undetailed"
|
||||
Style: Maori,"Maori style {prompt} . New Zealand, tattoo, spiritual, highly detailed","non-New Zealand, body paint, secular, undetailed"
|
||||
Style: Aboriginal,"Aboriginal style {prompt} . Australian indigenous, dot painting, storytelling, highly detailed","non-Australian, line drawing, non-narrative, undetailed"
|
||||
Style: Inuit,"Inuit style {prompt} . Arctic, stone carving, animal figures, highly detailed","tropical, wood carving, human figures, undetailed"
|
||||
Style: Saami,"Saami style {prompt} . Nordic indigenous, duodji (craft), reindeer, highly detailed","non-Nordic, factory-made, cow, undetailed"
|
||||
Style: Ojibwe,"Ojibwe style {prompt} . Native American, birch bark, canoes, highly detailed","non-Native American, pine bark, rafts, undetailed"
|
||||
Style: Tlingit,"Tlingit style {prompt} . Native American, totem poles, spiritual, highly detailed","non-Native American, street signs, secular, undetailed"
|
||||
Style: Navajo,"Navajo style {prompt} . Native American, textile, rug weaving, highly detailed","non-Native American, metalwork, jewelry making, undetailed"
|
||||
Style: Apache,"Apache style {prompt} . Native American, basketry, coiled, highly detailed","non-Native American, pottery, thrown, undetailed"
|
||||
Style: Zuni,"Zuni style {prompt} . Native American, jewelry, silver, highly detailed","non-Native American, clothing, cotton, undetailed"
|
||||
Style: Hopi,"Hopi style {prompt} . Native American, kachina dolls, spiritual, highly detailed","non-Native American, action figures, secular, undetailed"
|
||||
Style: Sioux,"Sioux style {prompt} . Native American, quillwork, porcupine, highly detailed","non-Native American, embroidery, silk, undetailed"
|
||||
Style: Lakota,"Lakota style {prompt} . Native American, beadwork, clothing, highly detailed","non-Native American, sequin work, banners, undetailed"
|
||||
Style: Yupik,"Yupik style {prompt} . Native American, mask, ceremonial, highly detailed","non-Native American, mask, recreational, undetailed"
|
||||
Style: Cherokee,"Cherokee style {prompt} . Native American, pottery, stamped, highly detailed","non-Native American, pottery, painted, undetailed"
|
||||
Style: Mohawk,"Mohawk style {prompt} . Native American, sweetgrass, basketry, highly detailed","non-Native American, bamboo, basketry, undetailed"
|
||||
Style: Cree,"Cree style {prompt} . Native American, hide, clothing, highly detailed","non-Native American, synthetic material, clothing, undetailed"
|
||||
Style: Acoma,"Acoma style {prompt} . Native American, pottery, sky city, highly detailed","non-Native American, pottery, earth city, undetailed"
|
||||
Style: Laguna,"Laguna style {prompt} . Native American, pottery, polychrome, highly detailed","non-Native American, pottery, monochrome, undetailed"
|
||||
Style: Seminole,"Seminole style {prompt} . Native American, patchwork, clothing, highly detailed","non-Native American, knitting, clothing, undetailed"
|
||||
Style: Osage,"Osage style {prompt} . Native American, ribbon work, floral, highly detailed","non-Native American, beadwork, geometric, undetailed"
|
||||
Style: Anasazi,"Anasazi style {prompt} . Native American, pottery, black-on-white, highly detailed","non-Native American, pottery, color-on-color, undetailed"
|
||||
Style: Mimbres,"Mimbres style {prompt} . Native American, pottery, figurative, highly detailed","non-Native American, pottery, abstract, undetailed"
|
||||
Style: Pomo,"Pomo style {prompt} . Native American, basketry, feathers, highly detailed","non-Native American, basketry, beads, undetailed"
|
||||
Style: Hohokam,"Hohokam style {prompt} . Native American, pottery, red-on-buff, highly detailed","non-Native American, pottery, blue-on-cream, undetailed"
|
||||
Style: Mississippian,"Mississippian style {prompt} . Native American, stone carving, ceremonial, highly detailed","non-Native American, wood carving, everyday, undetailed"
|
||||
Style: Fremont,"Fremont style {prompt} . Native American, petroglyphs, rock art, highly detailed","non-Native American, graffiti, wall art, undetailed"
|
||||
Style: Mogollon,"Mogollon style {prompt} . Native American, pottery, geometric, highly detailed","non-Native American, pottery, organic, undetailed"
|
||||
Style: Salado,"Salado style {prompt} . Native American, pottery, polychrome, highly detailed","non-Native American, pottery, duochrome, undetailed"
|
||||
Style: Zulu,"Zulu style {prompt} . African, basketry, coiled, highly detailed","non-African, pottery, thrown, undetailed"
|
||||
Style: Maasai,"Maasai style {prompt} . African, beadwork, jewelry, highly detailed","non-African, macramé, wall hanging, undetailed"
|
||||
Style: Ndebele,"Ndebele style {prompt} . African, mural art, homes, highly detailed","non-African, canvas art, studios, undetailed"
|
||||
Style: Kuba,"Kuba style {prompt} . African, textile, raffia, highly detailed","non-African, metalwork, steel, undetailed"
|
||||
Style: Yoruba,"Yoruba style {prompt} . African, sculpture, spiritual, highly detailed","non-African, photography, secular, undetailed"
|
||||
Style: Akan,"Akan style {prompt} . African, gold weights, symbolic, highly detailed","non-African, silver weights, literal, undetailed"
|
||||
Style: Berber,"Berber style {prompt} . North African, jewelry, silver, highly detailed","non-North African, clothing, cotton, undetailed"
|
||||
Style: Dogon,"Dogon style {prompt} . African, wood carving, spiritual, highly detailed","non-African, stone carving, secular, undetailed"
|
||||
Style: Fang,"Fang style {prompt} . African, mask, ceremonial, highly detailed","non-African, mask, recreational, undetailed"
|
||||
Style: Baga,"Baga style {prompt} . African, mask, spiritual, highly detailed","non-African, mask, secular, undetailed"
|
||||
>>>>>> GPT Culture Movies Prompts
|
||||
Style: Blade Runner,"Blade Runner {prompt} . Cyberpunk, neon-lit, rainy, dystopian, noir, cinematic, highly detailed","bright, sunny, utopian, cheerful, undetailed"
|
||||
Style: Star Wars,"Star Wars {prompt} . Space opera, galaxy far, far away, epic, iconic, cinematic, highly detailed","earthly, small scale, uniconic, undetailed"
|
||||
Style: Lord of the Rings,"Lord of the Rings {prompt} . Epic fantasy, Middle-earth, vast landscapes, highly detailed","science fiction, cityscape, undetailed"
|
||||
Style: Matrix,"Matrix {prompt} . Cyberpunk, green tint, reality-bending, cinematic, highly detailed","rustic, brown tint, reality-based, undetailed"
|
||||
Style: Indiana Jones,"Indiana Jones {prompt} . Adventure, archaeology, exotic locations, cinematic, highly detailed","domestic, library, unadventurous, undetailed"
|
||||
Style: Mad Max,"Mad Max {prompt} . Post-apocalyptic, desert landscapes, dystopian, cinematic, highly detailed","utopian, lush landscapes, pre-apocalyptic, undetailed"
|
||||
Style: 2001: A Space Odyssey,"2001: A Space Odyssey {prompt} . Sci-fi, space exploration, monolith, cinematic, highly detailed","fantasy, earth exploration, monochrome, undetailed"
|
||||
Style: Alien,"Alien {prompt} . Sci-fi horror, space, xenomorphs, dark, highly detailed","comedy, bright, undetailed"
|
||||
Style: Avatar,"Avatar {prompt} . Sci-fi, Pandora, bioluminescent, 3D, highly detailed","earthly, non-bioluminescent, 2D, undetailed"
|
||||
Style: Pulp Fiction,"Pulp Fiction {prompt} . Crime, non-linear narrative, 90s, highly detailed","linear narrative, 2000s, undetailed"
|
||||
Style: Kill Bill,"Kill Bill {prompt} . Martial arts, vengeance, yellow jumpsuit, cinematic, highly detailed","peaceful, pink jumpsuit, undetailed"
|
||||
Style: Inception,"Inception {prompt} . Sci-fi, dream within a dream, mind-bending, cinematic, highly detailed","reality-based, straightforward, undetailed"
|
||||
Style: Fight Club,"Fight Club {prompt} . Dark, gritty, psychological drama, highly detailed","light, glossy, undramatic, undetailed"
|
||||
Style: Harry Potter,"Harry Potter {prompt} . Fantasy, Hogwarts, wizardry, highly detailed","science fiction, non-magical, undetailed"
|
||||
Style: Marvel Cinematic Universe,"Marvel Cinematic Universe {prompt} . Superheroes, epic battles, colorful, highly detailed","ordinary people, small conflicts, monochrome, undetailed"
|
||||
Style: DC Extended Universe,"DC Extended Universe {prompt} . Superheroes, grim, darker tones, highly detailed","ordinary people, cheerful, brighter tones, undetailed"
|
||||
Style: Game of Thrones,"Game of Thrones {prompt} . Fantasy, Westeros, dragons, highly detailed","science fiction, no dragons, undetailed"
|
||||
Style: Twilight,"Twilight {prompt} . Romantic fantasy, vampires, Pacific Northwest, highly detailed","non-romantic, zombies, desert, undetailed"
|
||||
Style: Transformers,"Transformers {prompt} . Sci-fi, giant robots, explosions, highly detailed","fantasy, small creatures, calm, undetailed"
|
||||
Style: The Hunger Games,"The Hunger Games {prompt} . Dystopian, survival, rebellion, highly detailed","utopian, abundance, conformity, undetailed"
|
||||
Style: Pirates of the Caribbean,"Pirates of the Caribbean {prompt} . Adventure, pirates, supernatural, highly detailed","domestic, non-pirates, realistic, undetailed"
|
||||
Style: Jurassic Park,"Jurassic Park {prompt} . Adventure, dinosaurs, Isla Nublar, highly detailed","undramatic, no dinosaurs, mainland, undetailed"
|
||||
Style: The Shining,"The Shining {prompt} . Horror, haunted hotel, psychological thriller, highly detailed","comedy, non-haunted hotel, undetailed"
|
||||
Style: The Godfather,"The Godfather {prompt} . Crime, mafia, 1940s-1950s, highly detailed","law-abiding, 2000s, undetailed"
|
||||
Style: The Dark Knight,"The Dark Knight {prompt} . Superhero, gritty, Batman, Joker, highly detailed","light-hearted, Superman, undetailed"
|
||||
Style: Casablanca,"Casablanca {prompt} . Drama, romance, WWII, highly detailed","action, non-romantic, modern day, undetailed"
|
||||
Style: Jaws,"Jaws {prompt} . Thriller, shark, Amity Island, highly detailed","comedy, no shark, mainland, undetailed"
|
||||
Style: The Wizard of Oz,"The Wizard of Oz {prompt} . Fantasy, musical, Technicolor, Oz, highly detailed","realistic, non-musical, monochrome, Kansas, undetailed"
|
||||
Style: E.T.,"E.T. {prompt} . Sci-fi, family, suburban, highly detailed","fantasy, non-family, urban, undetailed"
|
||||
Style: Ghostbusters,"Ghostbusters {prompt} . Comedy, supernatural, New York City, highly detailed","horror, natural, rural, undetailed"
|
||||
Style: Back to the Future,"Back to the Future {prompt} . Sci-fi, time travel, DeLorean, highly detailed","fantasy, time stationary, non-vehicle, undetailed"
|
||||
Style: Toy Story,"Toy Story {prompt} . Animated, toys come to life, friendship, highly detailed","live-action, inanimate toys, rivalry, undetailed"
|
||||
Style: The Lion King,"The Lion King {prompt} . Animated, animal kingdom, African savannah, highly detailed","live-action, human kingdom, urban, undetailed"
|
||||
Style: Finding Nemo,"Finding Nemo {prompt} . Animated, ocean adventure, Great Barrier Reef, highly detailed","live-action, land adventure, desert, undetailed"
|
||||
Style: Shrek,"Shrek {prompt} . Animated, fairytale, swamp, highly detailed","live-action, realistic, city, undetailed"
|
||||
Style: The Little Mermaid,"The Little Mermaid {prompt} . Animated, undersea, mermaids, highly detailed","live-action, land, humans, undetailed"
|
||||
Style: Aladdin,"Aladdin {prompt} . Animated, Arabian Nights, magic carpet, highly detailed","live-action, modern day, ordinary carpet, undetailed"
|
||||
Style: Beauty and the Beast,"Beauty and the Beast {prompt} . Animated, fairytale, enchanted castle, highly detailed","live-action, realistic, ordinary house, undetailed"
|
||||
Style: Cinderella,"Cinderella {prompt} . Animated, fairytale, magical transformation, highly detailed","live-action, realistic, ordinary transformation, undetailed"
|
||||
Style: Sleeping Beauty,"Sleeping Beauty {prompt} . Animated, fairytale, spinning wheel, highly detailed",""live-action, realistic, sewing machine, undetailed"
|
||||
Style: Snow White,"Snow White {prompt} . Animated, fairytale, seven dwarfs, highly detailed","live-action, realistic, seven giants, undetailed"
|
||||
Style: Mulan,"Mulan {prompt} . Animated, historical, Chinese warfare, highly detailed","live-action, futuristic, space warfare, undetailed"
|
||||
Style: Pocahontas,"Pocahontas {prompt} . Animated, historical, Native American, highly detailed","live-action, modern, urban American, undetailed"
|
||||
Style: The Nightmare Before Christmas,"The Nightmare Before Christmas {prompt} . Stop-motion, Halloween Town, Christmas Town, highly detailed","live-action, Easter Town, undetailed"
|
||||
Style: Frozen,"Frozen {prompt} . Animated, fairytale, ice magic, highly detailed","live-action, realistic, fire magic, undetailed"
|
||||
Style: Moana,"Moana {prompt} . Animated, Polynesian, ocean adventure, highly detailed","live-action, Nordic, mountain adventure, undetailed"
|
||||
Style: Tangled,"Tangled {prompt} . Animated, fairytale, magic hair, highly detailed","live-action, realistic, ordinary hair, undetailed"
|
||||
Style: Zootopia,"Zootopia {prompt} . Animated, anthropomorphic animals, urban, highly detailed","live-action, humans, rural, undetailed"
|
||||
Style: Coco,"Coco {prompt} . Animated, Dia de los Muertos, Mexican culture, highly detailed","live-action, Halloween, American culture, undetailed"
|
||||
Style: Brave,"Brave {prompt} . Animated, Scottish highlands, archery, highly detailed","live-action, tropical island, surfing, undetailed"
|
||||
Style: Inside Out,"Inside Out {prompt} . Animated, emotions, abstract, highly detailed","live-action, logical thinking, realistic, undetailed"
|
||||
Style: The Incredibles,"The Incredibles {prompt} . Animated, superhero, family, highly detailed","live-action, villain, solitary, undetailed"
|
||||
Style: Up,"Up {prompt} . Animated, adventure, flying house, highly detailed","live-action, everyday life, stationary house, undetailed"
|
||||
Style: Wall-E,"Wall-E {prompt} . Animated, post-apocalyptic, robots, highly detailed","live-action, pre-apocalyptic, humans, undetailed"
|
||||
Style: Ratatouille,"Ratatouille {prompt} . Animated, culinary, Paris, highly detailed","live-action, non-culinary, New York, undetailed"
|
||||
Style: Monsters Inc.,"Monsters Inc. {prompt} . Animated, monsters, scare factory, highly detailed","live-action, humans, laughter factory, undetailed"
|
||||
Style: Cars,"Cars {prompt} . Animated, anthropomorphic cars, racing, highly detailed","live-action, humans, walking, undetailed"
|
||||
Style: A Bug's Life,"A Bug's Life {prompt} . Animated, insects, ant colony, highly detailed","live-action, mammals, human society, undetailed"
|
||||
Style: James Bond,"James Bond {prompt} . Spy, action, globe-trotting, highly detailed","romantic comedy, peace, domestic, undetailed"
|
||||
Style: Fast and Furious,"Fast and Furious {prompt} . Action, car chases, family, highly detailed","romantic comedy, pedestrian chases, solitary, undetailed"
|
||||
Style: Mission Impossible,"Mission Impossible {prompt} . Action, spy, impossible stunts, highly detailed","romantic comedy, everyday person, possible stunts, undetailed"
|
||||
Style: Jurassic World,"Jurassic World {prompt} . Adventure, dinosaurs, theme park, highly detailed","romantic comedy, no dinosaurs, city park, undetailed"
|
||||
Style: Minions,"Minions {prompt} . Animated, comedy, minions, highly detailed","live-action, drama, no minions, undetailed"
|
||||
Style: Interstellar,"Interstellar {prompt} . Sci-fi, space travel, wormholes, highly detailed","romantic comedy, earth travel, roads, undetailed"
|
||||
Style: The Grinch,"The Grinch {prompt} . Animated, Christmas, Whoville, highly detailed","live-action, summer, city, undetailed"
|
||||
Style: Avengers: Endgame,"Avengers: Endgame {prompt} . Superhero, epic battle, time travel, highly detailed","romantic comedy, small conflict, present time, undetailed"
|
||||
Style: Wonder Woman,"Wonder Woman {prompt} . Superhero, Amazonian, World War I, highly detailed","romantic comedy, non-Amazonian, modern day, undetailed"
|
||||
Style: The Iron Giant,"The Iron Giant {prompt} . Animated, robot, 1950s, highly detailed","live-action, human, modern day, undetailed"
|
||||
Style: Godzilla,"Godzilla {prompt} . Monster, destruction, cityscape, highly detailed","romantic comedy, creation, countryside, undetailed"
|
||||
Style: King Kong,"King Kong {prompt} . Monster, island, skyscraper, highly detailed","romantic comedy, mainland, low-rise, undetailed"
|
||||
Style: The Grand Budapest Hotel,"The Grand Budapest Hotel {prompt} . Comedy, hotel, pastel colors, highly detailed","action, wilderness, dark colors, undetailed"
|
||||
Style: Inside Llewyn Davis,"Inside Llewyn Davis {prompt} . Drama, folk music, 1960s, highly detailed","action, pop music, modern day, undetailed"
|
||||
Style: Drive,"Drive {prompt} . Action, neon, 1980s aesthetic, highly detailed","romantic comedy, daylight, modern aesthetic, undetailed"
|
||||
Style: The Neon Demon,"The Neon Demon {prompt} . Horror, fashion, Los Angeles, highly detailed","romantic comedy, construction, New York, undetailed"
|
||||
Style: It Follows,"It Follows {prompt} . Horror, supernatural, suburbia, highly detailed","romantic comedy, natural, city, undetailed"
|
||||
Style: Dunkirk,"Dunkirk {prompt} . War, World War II, beach, highly detailed","romantic comedy, peace, city, undetailed"
|
||||
Style: Her,"Her {prompt} . Romance, sci-fi, artificial intelligence, highly detailed","action, reality, human intelligence, undetailed"
|
||||
Style: The Revenant,"The Revenant {prompt} . Drama, survival, wilderness, highly detailed","romantic comedy, luxury, city, undetailed"
|
||||
Style: Whiplash,"Whiplash {prompt} . Drama, music, drumming, highly detailed","action, silence, no music, undetailed"
|
||||
Style: The Shape of Water,"The Shape of Water {prompt} . Fantasy, romance, aquatic creature, highly detailed","action, hatred, terrestrial creature, undetailed"
|
||||
Style: A Ghost Story,"A Ghost Story {prompt} . Drama, supernatural, ghost, highly detailed","romantic comedy, natural, human, undetailed"
|
||||
Style: The Florida Project,"The Florida Project {prompt} . Drama, childhood, motel, highly detailed","action, adulthood, skyscraper, undetailed"
|
||||
Style: La La Land,"La La Land {prompt} . Musical, romance, Los Angeles, highly detailed","action, hatred, New York, undetailed"
|
||||
Style: The Lobster,"The Lobster {prompt}". Dark comedy, dystopian, relationship rules, highly detailed","romantic comedy, utopian, no relationship rules, undetailed"
|
||||
Style: Ex Machina,"Ex Machina {prompt} . Sci-fi, artificial intelligence, secluded mansion, highly detailed","romantic comedy, human intelligence, bustling city, undetailed"
|
||||
Style: Birdman,"Birdman {prompt} . Drama, Broadway, magical realism, highly detailed","action, Hollywood, realism, undetailed"
|
||||
Style: Gravity,"Gravity {prompt} . Sci-fi, space, survival, highly detailed","romantic comedy, earth, abundance, undetailed"
|
||||
Style: The Tree of Life,"The Tree of Life {prompt} . Drama, philosophical, nonlinear narrative, highly detailed","action, practical, linear narrative, undetailed"
|
||||
Style: Inception,"Inception {prompt} . Sci-fi, dream manipulation, heist, highly detailed","romantic comedy, reality, gift-giving, undetailed"
|
||||
Style: The Social Network,"The Social Network {prompt} . Drama, Facebook, entrepreneurship, highly detailed","action, Myspace, employment, undetailed"
|
||||
Style: Moonlight,"Moonlight {prompt} . Drama, coming-of-age, Miami, highly detailed","action, aging, Los Angeles, undetailed"
|
||||
Style: Roma,"Roma {prompt} . Drama, Mexico City, 1970s, highly detailed","action, New York City, modern day, undetailed"
|
||||
Style: Parasite,"Parasite {prompt} . Thriller, class disparity, South Korea, highly detailed","romantic comedy, class equality, United States, undetailed"
|
||||
Style: 1917,"1917 {prompt} . War, World War I, single shot, highly detailed","romantic comedy, peace, multiple shots, undetailed"
|
||||
Style: Jojo Rabbit,"Jojo Rabbit {prompt} . Comedy, World War II, imaginary friend, highly detailed","drama, modern day, real friend, undetailed"
|
||||
Style: Joker,"Joker {prompt} . Drama, psychological, Gotham City, highly detailed","romantic comedy, psychological well-being, Metropolis, undetailed"
|
||||
Style: The Lighthouse,"The Lighthouse {prompt} . Drama, isolation, lighthouse, highly detailed","romantic comedy, community, city, undetailed"
|
||||
Style: Once Upon a Time in Hollywood,"Once Upon a Time in Hollywood {prompt} . Comedy-drama, 1960s Hollywood, film industry, highly detailed","action, modern Hollywood, tech industry, undetailed"
|
||||
Style: The Irishman,"The Irishman {prompt} . Crime, mafia, aging, highly detailed","romantic comedy, law-abiding citizens, youth, undetailed"
|
||||
Style: Uncut Gems,"Uncut Gems {prompt} . Crime, debt, gambling, highly detailed","romantic comedy, abundance, saving, undetailed"
|
||||
Style: Little Women,"Little Women {prompt} . Drama, coming-of-age, Civil War era, highly detailed","action, aging, modern day, undetailed"
|
||||
Style: Knives Out,"Knives Out {prompt} . Mystery, whodunit, wealthy family, highly detailed","romantic comedy, clear culprit, poor family, undetailed"
|
||||
Style: Marriage Story,"Marriage Story {prompt} . Drama, divorce, bi-coastal, highly detailed","romantic comedy, marriage, same city, undetailed"
|
||||
Style: Midsommar,"Midsommar {prompt} . Horror, cult, Sweden, highly detailed","romantic comedy, mainstream religion, United States, undetailed"
|
||||
Style: Booksmart,"Booksmart {prompt} . Comedy, high school, overachievers, highly detailed","drama, college, underachievers, undetailed"
|
||||
Style: Ford v Ferrari,"Ford v Ferrari {prompt} . Drama, racing, 1960s, highly detailed","romantic comedy, walking, modern day, undetailed"
|
||||
Style: Rocketman,"Rocketman {prompt} . Musical, biographical, Elton John, highly detailed","action, fictional, ordinary person, undetailed"
|
||||
Style: Ad Astra,"Ad Astra {prompt} . Sci-fi, space travel, father-son relationship, highly detailed","romantic comedy, earth travel, romantic relationship, undetailed"
|
||||
Style: Waves,"Waves {prompt} . Drama, family tragedy, forgiveness, highly detailed","romantic comedy, family comedy, grudge, undetailed"
|
||||
Style: The Farewell,"The Farewell {prompt} . Drama, family, cultural conflict, highly detailed","romantic comedy, strangers, cultural harmony, undetailed"
|
||||
Style: Hustlers,"Hustlers {prompt} . Drama, strippers, financial crime, highly detailed","romantic comedy, office workers, financial responsibility, undetailed"
|
||||
Style: Portrait of a Lady on Fire,"Portrait of a Lady on Fire {prompt} . Romance, art, 18th century France, highly detailed","action, science, modern day United States, undetailed"
|
||||
Style: Pain and Glory,"Painand Glory {prompt} . Drama, filmmaking, memory, highly detailed","romantic comedy, accounting, forgetfulness, undetailed"
|
||||
Style: The Two Popes,"The Two Popes {prompt} . Drama, Vatican, philosophical discussions, highly detailed","action, a small town, physical challenges, undetailed"
|
||||
Style: A Beautiful Day in the Neighborhood,"A Beautiful Day in the Neighborhood {prompt} . Drama, Fred Rogers, kindness, highly detailed","action, a villainous character, ruthlessness, undetailed"
|
||||
Style: The Peanut Butter Falcon,"The Peanut Butter Falcon {prompt} . Adventure, friendship, wrestling, highly detailed","romantic comedy, rivalry, chess, undetailed"
|
||||
Style: The Goldfinch,"The Goldfinch {prompt} . Drama, art, trauma, highly detailed","action, science, joy, undetailed"
|
||||
Style: High Life,"High Life {prompt} . Sci-fi, space travel, isolation, highly detailed","romantic comedy, road trip, companionship, undetailed"
|
||||
Style: The Nightingale,"The Nightingale {prompt} . Drama, revenge, colonial Tasmania, highly detailed","romantic comedy, forgiveness, modern California, undetailed"
|
||||
Style: Yesterday,"Yesterday {prompt} . Comedy, music, The Beatles, highly detailed","drama, silence, unknown band, undetailed"
|
||||
Style: Doctor Sleep,"Doctor Sleep {prompt} . Horror, supernatural, The Shining sequel, highly detailed","romantic comedy, natural, standalone story, undetailed"
|
||||
Style: The Farewell,"The Farewell {prompt} . Drama, family, terminal illness, highly detailed","romantic comedy, friends, good health, undetailed"
|
||||
Style: John Wick 3,"John Wick 3 {prompt} . Action, assassin, relentless pursuit, highly detailed","romantic comedy, pacifist, peaceful life, undetailed"
|
||||
Style: Us,"Us {prompt} . Horror, doppelgängers, underground, highly detailed","romantic comedy, identical twins, above ground, undetailed"
|
||||
Style: The Irishman,"The Irishman {prompt} . Crime, mobster, union, highly detailed","romantic comedy, law-abiding citizen, small business, undetailed"
|
||||
Style: Honey Boy,"Honey Boy {prompt} . Drama, father-son relationship, Hollywood, highly detailed","romantic comedy, mother-daughter relationship, a small town, undetailed"
|
||||
Style: Joker,"Joker {prompt} . Drama, mental health, Gotham City, highly detailed","romantic comedy, mental well-being, Metropolis, undetailed"
|
||||
Style: Uncut Gems,"Uncut Gems {prompt} . Crime, gambling, New York City's Diamond District, highly detailed","romantic comedy, savings, rural town, undetailed"
|
||||
Style: 1917,"1917 {prompt} . War, World War I, real-time, highly detailed","romantic comedy, peacetime, timeless, undetailed"
|
||||
Style: Ford v Ferrari,"Ford v Ferrari {prompt} . Drama, racing, corporate politics, highly detailed","romantic comedy, walking, friendship, undetailed"
|
||||
Style: Cats,"Cats {prompt} . Musical, anthropomorphic cats, surreal, highly detailed","action, ordinary humans, realism, undetailed"
|
||||
Style: Jojo Rabbit,"Jojo Rabbit {prompt} . Comedy-drama, World War II, Hitler Youth, highly detailed","romantic comedy, modern day, ordinary youth, undetailed"
|
||||
Style: Parasite,"Parasite {prompt} . Drama, social class, deception, highly detailed","romantic comedy, equality, honesty, undetailed"
|
||||
Style: The Lion King,"The Lion King {prompt} . Animated, animal kingdom, Shakespearean, highly detailed","live-action, human kingdom, modern, undetailed"
|
||||
Style: Aladdin,"Aladdin {prompt} . Animated, Middle Eastern, magic, highly detailed","live-action, Western, science, undetailed"
|
||||
Style: Toy Story 4,"Toy Story 4 {prompt} . Animated, toys, adventure, highly detailed","live-action, non-living objects, ordinary life, undetailed"
|
||||
Style: Avengers: Endgame,"Avengers: Endgame {prompt} . Superhero, epic, time travel, highly detailed","romantic comedy, small-scale, present day, undetailed"
|
||||
Style: Star Wars: The Rise of Skywalker,"Star Wars: The Rise of Skywalker {prompt} . Sci-fi, space opera, Jedi, highly detailed","romantic comedy, earthbound, everyday person, undetailed"
|
||||
Style: Downton Abbey,"Downton Abbey {prompt} . Drama, British aristocracy, period piece, highly detailed","romantic comedy, modern middle class, present day, undetailed"
|
||||
Style: Frozen 2,"Frozen 2 {prompt} . Animated, fairytale, sisterhood, highly detailed","live-action, realism, rivalry, undetailed"
|
||||
Style: Little Women,"Little Women {prompt} . Drama, sisters, Civil War era, highly detailed","action, brothers, modern day, undetailed"
|
||||
>>>>>> GPT Anime Cartoon Mangas
|
||||
Style: 2D Traditional Animation,"traditional 2D animation {prompt} . hand-drawn, frames, expressive, vibrant colors, highly detailed","3D, CG, stop-motion, photo-realistic, black and white"
|
||||
Style: CGI Animation,"CGI animation {prompt} . 3D, photorealistic, high-quality textures and lighting, highly detailed","2D, stop-motion, anime, manga, black and white"
|
||||
Style: Stop-Motion Animation,"stop-motion animation {prompt} . physical models, frame-by-frame, quirky, distinctive, highly detailed","2D, 3D, CG, anime, manga, black and white"
|
||||
Style: Claymation,"claymation {prompt} . clay models, stop-motion, handcrafted, tactile, highly detailed","2D, 3D, CG, anime, manga, black and white"
|
||||
Style: Vector Animation,"vector animation {prompt} . digital, clean lines, geometric shapes, bold colors, highly detailed","stop-motion, claymation, 3D, CG, black and white"
|
||||
Style: Flash Animation,"flash animation {prompt} . digital, vector graphics, tweening, simple shapes, highly detailed","stop-motion, claymation, 3D, CG, black and white"
|
||||
Style: Rotoscope Animation,"rotoscope animation {prompt} . traced over live-action, realistic movement, highly detailed","stop-motion, claymation, 3D, CG, black and white"
|
||||
Style: Cut-Out Animation,"cut-out animation {prompt} . paper or fabric cut-outs, stop-motion, handcrafted, highly detailed","2D, 3D, CG, anime, manga, black and white"
|
||||
Style: Sand Animation,"sand animation {prompt} . sand manipulated on light box, fluid movement, highly detailed","2D, 3D, CG, anime, manga, black and white"
|
||||
Style: Pixel Art Animation,"pixel art animation {prompt} . low-res, blocky, digital, 8-bit, highly detailed","stop-motion, claymation, 3D, CG, black and white"
|
||||
Style: Anime Style Animation,"anime style animation {prompt} . Japanese style, hand-drawn or digital, vibrant, unique character designs, highly detailed","western cartoons, 3D, CG, black and white"
|
||||
Style: Manga Style Art,"manga style {prompt} . Japanese comics, black and white, unique character designs, detailed backgrounds, highly detailed","western comics, 3D, CG, vibrant colors"
|
||||
Style: Chibi Style Art,"chibi style {prompt} . Japanese, super-deformed, cute, exaggerated features, vibrant colors, highly detailed","realistic, 3D, CG, western comics, black and white"
|
||||
Style: Superflat,"superflat {prompt} . Japanese, postmodern art, flat planes of color, manga and anime influences, highly detailed","3D, CG, western art styles, black and white"
|
||||
Style: Ukiyo-e,"ukiyo-e style {prompt} . Japanese woodblock prints, flat areas of color, detailed patterns, subjects from history and mythology, highly detailed","modern, 3D, CG, western art styles, black and white"
|
||||
Style: Western Comics Art,"western comics art {prompt} . bold lines, dynamic poses, vibrant colors, dramatic lighting, highly detailed","anime, manga, 3D, CG, black and white"
|
||||
Style: Graphic Novel Art,"graphic novel art {prompt} . detailed, expressive, ranges from black and white to full color, often more realistic than traditional comics, highly detailed","anime, manga, 3D, CG, western comics"
|
||||
Style: Cartoon Modern,"cartoon modern {prompt} . mid-century modern aesthetic, stylized, geometric shapes, flat colors, highly detailed","realistic, 3D, CG, anime, manga, black and white"
|
||||
Style: Abstract Animation,"abstract animation {prompt} . nonrepresentational, uses movement and color to create mood or emotion, highly detailed","realistic, 3D, CG, anime, manga, black and white"
|
||||
Style: Silhouette Animation,"silhouette animation {prompt} . black figures against light background, dramatic, based on shadow puppetry, highly detailed","colorful, 3D, CG, anime, manga, black and white"
|
||||
Style: Looney Tunes,"Looney Tunes {prompt} . Cartoon, slapstick humor, dynamic and exaggerated character designs, colorful, vibrant, whimsical","3D, realism, manga, black and white, subdued, serious"
|
||||
Style: Disney Classic,"Disney Classic {prompt} . Animation, fairy tales, musical numbers, expressive characters, bright colors, detailed, professional","manga, anime, black and white, sketchy, rough"
|
||||
Style: Studio Ghibli,"Studio Ghibli {prompt} . Anime, magical realism, environmental themes, unique characters, breathtaking landscapes, highly detailed","cartoon, slapstick, black and white, photo-realistic, barren"
|
||||
Style: Pixar,"Pixar {prompt} . 3D animation, heartwarming stories, photorealistic environments, appealing character designs, emotional depth, detailed, professional","2D, anime, manga, black and white, sketchy"
|
||||
Style: Shōnen,"Shōnen {prompt} . Manga, action-packed, youthful characters, dynamic battles, inspiring themes, highly detailed","Disney, Pixar, black and white, realism, romantic comedy"
|
||||
Style: Mecha,"Mecha {prompt} . Anime, robots, futuristic technologies, dynamic battles, detailed mechanical designs, highly detailed","Disney, Pixar, cartoon, Looney Tunes, realism, fairy tales"
|
||||
Style: Shojo,"Shojo {prompt} . Manga, romantic themes, delicate art style, emotional narratives, highly detailed","action, mecha, 3D, Pixar, black and white, barren"
|
||||
Style: Nickelodeon,"Nickelodeon {prompt} . Cartoon, humor, dynamic characters, wacky and colorful designs, highly detailed","anime, manga, black and white, sketchy, serious"
|
||||
Style: Cartoon Network,"Cartoon Network {prompt} . Cartoon, humor, dynamic characters, unique and abstract designs, highly detailed","anime, manga, black and white, sketchy, serious"
|
||||
Style: Adult Swim,"Adult Swim {prompt} . Animation, adult humor, surreal themes, unique and abstract designs, highly detailed","children's cartoons, Disney, fairy tales, bright colors, traditional"
|
||||
Style: Adventure Time,"Adventure Time {prompt} . Cartoon, fantasy themes, quirky characters, vibrant colors, highly detailed","anime, manga, black and white, sketchy, serious"
|
||||
Style: Rick and Morty,"Rick and Morty {prompt} . Cartoon, science fiction, adult humor, unique and abstract designs, highly detailed","children's cartoons, Disney, fairy tales, bright colors, traditional"
|
||||
Style: South Park,"South Park {prompt} . Animation, satire, crude humor, simplistic designs, highly detailed","anime, manga, Disney, Pixar, detailed, professional"
|
||||
Style: The Simpsons,"The Simpsons {prompt} . Animation, satire, family themes, recognizable yellow characters, highly detailed","anime, manga, Disney, Pixar, black and white"
|
||||
Style: Family Guy,"Family Guy {prompt} . Animation, adult humor, satirical themes, cartoonish designs, highly detailed","anime, manga, Disney, Pixar, black and white"
|
||||
Style: Bob's Burgers,"Bob's Burgers {prompt} . Animation, family themes, humor, quirky characters, highly detailed","anime, manga, Disney, Pixar, black and white"
|
||||
Style: Gravity Falls,"Gravity Falls {prompt} . Cartoon, mystery, fantasy themes, unique character designs, highly detailed","anime, manga, Disney, Pixar, black and white"
|
||||
Style: Steven Universe,"Steven Universe {prompt} . Cartoon, LGBTQ+ themes, fantasy, vibrant colors, unique character designs, highly detailed","anime, manga, Disney, Pixar, black and white"
|
||||
Style: One Piece,"One Piece {prompt} . Manga, adventure, pirates, dynamic battles, unique character designs, highly detailed","cartoon, realism, Disney, Pixar, black and white"
|
||||
Style: Attack on Titan,"Attack on Titan {prompt} . Anime, dystopian, giants, dynamic battles, highly detailed","cartoon, realism, Disney, Pixar, black and white"
|
||||
Style: My Hero Academia,"My Hero Academia {prompt} . Anime, superhero, high school, dynamic battles, unique character designs, highly detailed","cartoon, realism, Disney, Pixar, black and white"
|
||||
Style: Naruto,"Naruto {prompt} . Anime, ninjas, coming-of-age, dynamic battles, unique character designs, highly detailed","cartoon, realism, Disney, Pixar, black and white"
|
||||
Style: Dragon Ball Z,"Dragon Ball Z {prompt} . Anime, martial arts, aliens, dynamic battles, unique character designs, highly detailed","cartoon, realism, Disney, Pixar, black and white"
|
||||
Style: Sailor Moon,"Sailor Moon {prompt} . Anime, magical girls, romance, unique character designs, highly detailed","cartoon, realism, Disney, Pixar, black and white"
|
||||
Style: Cowboy Bebop,"Cowboy Bebop {prompt} . Anime, space western, bounty hunters, noir themes, highly detailed","cartoon, realism, Disney, Pixar, black and white"
|
||||
>>>>>> GPT Famous Artists
|
||||
Style: Van Gogh, "Van Gogh style {prompt} . Expressive, impasto, swirling brushwork, vibrant," "realistic, photorealistic, calm, straight lines"
|
||||
Style: Warhol, "Warhol style {prompt} . Pop art, bold colors, mass production, repetitive," "subdued colors, traditional, unique, serious"
|
||||
Style: Picasso, "Picasso style {prompt} . Cubist, geometric, abstract, innovative," "realistic, detailed, smooth, fluid, single perspective"
|
||||
Style: Da Vinci, "Da Vinci style {prompt} . Realistic, sfumato, detailed, chiaroscuro," "abstract, vibrant colors, bold, loose brushwork"
|
||||
Style: Monet, "Monet style {prompt} . Impressionist, light-filled, loose brushwork, en plein air," "defined, detailed, subdued, studio work"
|
||||
Style: Dali, "Dali style {prompt} . Surrealist, dreamlike, bizarre, symbolic," "realistic, ordinary, rational, clear, obvious"
|
||||
Style: Pollock, "Pollock style {prompt} . Abstract expressionist, gestural, dripping, layered," "sharp, precise, realistic, calm"
|
||||
Style: Rothko, "Rothko style {prompt} . Color field, abstract, simple, large-scale," "detailed, small, complex, figurative"
|
||||
Style: Matisse, "Matisse style {prompt} . Fauvist, bold colors, loose, decorative," "realistic, subdued colors, detailed, serious"
|
||||
Style: Banksy, "Banksy style {prompt} . Street art, satirical, stenciled, urban," "classic, traditional, indoor, realism"
|
||||
Style: Michelangelo, "Michelinagelo style {prompt} . High Renaissance, sculptural, detailed, humanistic," "abstract, loose, simplistic, impersonal"
|
||||
Style: Kusama, "Kusama style {prompt} . Pop Art, abstract, polka dots, immersive," "plain, monotone, realistic, sparse"
|
||||
Style: Hokusai, "Hokusai style {prompt} . Ukiyo-e, woodblock print, detailed, narrative," "abstract, free-form, modern, minimal"
|
||||
Style: O'Keeffe, "O'Keeffe style {prompt} . Modernist, floral, bold, abstract," "small scale, detailed, muted colors, complex"
|
||||
Style: Cézanne, "Cézanne style {prompt} . Post-impressionist, geometric, detailed, brushstrokes," "smooth, flat, loose, fluid"
|
||||
Style: Hopper, "Hopper style {prompt} . Realistic, light and shadow, loneliness, American urban," "busy, crowded, vibrant, abstract"
|
||||
Style: Klimt, "Klimt style {prompt} . Symbolist, decorative, ornamental, sensual," "simple, bare, abstract, rough"
|
||||
Style: Chagall, "Chagall style {prompt} . Surrealist, dreamy, vibrant, narrative," "realistic, dull, serious, minimal"
|
||||
Style: Lichtenstein, "Lichtenstein style {prompt} . Pop art, comic strip, bold, ironic," "realistic, traditional, serious, detailed"
|
||||
Style: Basquiat, "Basquiat style {prompt} . Neo-expressionist, primitive, graffiti, social commentary," "polished, elegant, subdued, subtle"
|
||||
Style: Frida Kahlo, "Frida Kahlo style {prompt} . Symbolic, surrealistic, emotional, vibrant," "realistic, subdued, impersonal, monochromatic"
|
||||
Style: Georgia O'Keeffe, "Georgia O'Keeffe style {prompt} . Modernist, abstract, large scale, organic," "small, detailed, geometric, muted colors"
|
||||
Style: Jackson Pollock, "Jackson Pollock style {prompt} . Abstract expressionist, action painting, drip technique, energetic," "controlled, figurative, calm, small scale"
|
||||
Style: Rembrandt, "Rembrandt style {prompt} . Baroque, chiaroscuro, realistic, emotional," "flat lighting, abstract, impersonal, clean"
|
||||
Style: Renoir, "Renoir style {prompt} . Impressionist, vibrant, lively, warm," "dull, calm, detailed, cool colors"
|
||||
Style: Magritte, "Magritte style {prompt} . Surrealist, thought-provoking, mysterious, realistic," "abstract, obvious, open, unrefined"
|
||||
Style: Manet, "Manet style {prompt} . Realistic, impressionistic, bold, contemporary," "abstract, traditional, timid, historical"
|
||||
Style: Vermeer, "Vermeer style {prompt} . Baroque, detailed, light, tranquil," "abstract, rough, dark, chaotic"
|
||||
Style: Caravaggio, "Caravaggio style {prompt} . Baroque, chiaroscuro, dramatic, realistic," "soft lighting, calm, abstract, idealized"
|
||||
Style: Rodin, "Rodin style {prompt} . Realistic, expressive, textured, bronze," "smooth, emotionless, polished, painted"
|
||||
Style: Botticelli, "Botticelli style {prompt} . Early Renaissance, allegorical, graceful, detailed," "abstract, harsh, simplified, rough"
|
||||
Style: Edward Hopper, "Edward Hopper style {prompt} . Realistic, isolation, architectural, strong contrast," "crowded, organic, soft lighting, abstract"
|
||||
Style: Keith Haring, "Keith Haring style {prompt} . Pop art, bold lines, vibrant colors, social messages," "subtle, realistic, muted colors, personal"
|
||||
Style: Damien Hirst, "Damien Hirst style {prompt} . Contemporary, shocking, conceptual, large scale," "traditional, calming, handcrafted, small scale"
|
||||
Style: Yayoi Kusama, "Yayoi Kusama style {prompt} . Contemporary, polka dots, immersive, psychedelic," "traditional, plain, minimalist, calm"
|
||||
Style: Francis Bacon, "Francis Bacon style {prompt} . Existential, distorted, unsettling, expressive," "comforting, realistic, calm, subdued"
|
||||
Style: Ai Weiwei, "Ai Weiwei style {prompt} . Conceptual, political, traditional Chinese materials, large-scale," "apolitical, contemporary, small-scale, western materials"
|
||||
Style: Cindy Sherman, "Cindy Sherman style {prompt} . Conceptual, self-portrait, character study, cinematic," "landscape, group portraits, candid, documentary"
|
||||
Style: Frank Stella, "Frank Stella style {prompt} . Minimalist, geometric, large scale, non-representational," "maximalist, organic, small scale, representational"
|
||||
Style: Lucian Freud, "Lucian Freud style {prompt} . Realistic, impasto, psychological, intimate," "abstract, smooth, impersonal, public"
|
||||
Style: Marc Chagall, "Marc Chagall style {prompt} . Dreamlike, vibrant, symbolic, folklore-inspired," "realistic, subdued, literal, modern"
|
||||
Style: Roy Lichtenstein, "Roy Lichtenstein style {prompt} . Pop art, comic strip influence, bold outlines, primary colors," "abstract, realistic, pastel colors, complex"
|
||||
Style: Thomas Kinkade, "Thomas Kinkade style {prompt} . Romantic, idealized, warm light, detailed," "abstract, harsh, cool light, minimalist"
|
||||
Style: Joan Miró, "Joan Miró style {prompt} . Surrealist, abstract, biomorphic forms, primary colors," "realistic, figurative, complex, muted colors"
|
||||
Style: Gerhard Richter, "Gerhard Richter style {prompt} . Abstract, textured, layered, scraped," "realistic, smooth, single-layer, detailed"
|
||||
Style: Wassily Kandinsky, "Wassily Kandinsky style {prompt} . Abstract, geometric, vibrant, musical," "realistic, organic, muted, silent"
|
||||
Style: Norman Rockwell, "Norman Rockwell style {prompt} . Realistic, narrative, Americana, detailed," "abstract, non-narrative, foreign, minimalist"
|
||||
Style: Bridget Riley, "Bridget Riley style {prompt} . Op art, geometric, black and white, optical illusion," "organic, color, realistic, straightforward"
|
||||
Style: Piet Mondrian, "Piet Mondrian style {prompt} . De Stijl, geometric, primary colors, black grid," "organic, multiple colors, no grid, curved lines"
|
||||
Style: Salvador Dalí, "Salvador Dalí style {prompt} . Surrealist, dreamlike, symbolic, detailed," "realistic, ordinary, literal, sketchy"
|
||||
Style: Mary Cassatt, "Mary Cassatt style {prompt} . Impressionist, domestic life, soft colors, loose brushwork," "abstract, public life, vibrant colors, precise"
|
||||
Style: Diego Rivera, "Diego Rivera style {prompt} . Muralist, social realist, Mexican culture, narrative," "miniature, abstract, foreign, non-narrative"
|
||||
Style: Jean-Michel Basquiat, "Jean-Michel Basquiat style {prompt} . Neo-expressionist, graffiti influence, raw, socially critical," "classical, polished, refined, apolitical"
|
||||
Style: Henry Moore, "Henry Moore style {prompt} . Abstract, organic, bronze, monumental," "realistic, geometric, miniature, pastel"
|
||||
Style: Frida Kahlo, "Frida Kahlo style {prompt} . Surrealist, symbolic, vibrant, autobiographical," "realistic, abstract, dull, impersonal"
|
||||
Style: Grant Wood, "Grant Wood style {prompt} . Regionalist, rural, detailed, Americana," "urban, abstract, vague, non-American"
|
||||
Style: Edward Hopper, "Edward Hopper style {prompt} . Realistic, isolation, strong light, urban," "impressionistic, crowded, soft light, rural"
|
||||
Style: Andy Goldsworthy, "Andy Goldsworthy style {prompt} . Environmental art, natural materials, temporary, site-specific," "urban art, man-made materials, permanent, unspecific site"
|
||||
Style: Louise Bourgeois, "Louise Bourgeois style {prompt} . Abstract, psychological, large-scale, organic," "realistic, impersonal, small-scale, geometric"
|
||||
Style: Ansel Adams, "Ansel Adams style {prompt} . Black and white, nature, high contrast, detailed," "color, urban, low contrast, vague"
|
||||
Style: Yoko Ono, "Yoko Ono style {prompt} . Conceptual, minimalist, performance, participatory," "decorative, maximalist, static, non-interactive"
|
||||
Style: Gustav Klimt, "Gustav Klimt style {prompt} . Symbolist, decorative, golden, intricate," "realistic, functional, monochrome, simplified"
|
||||
Style: Jeff Koons, "Jeff Koons style {prompt} . Contemporary, kitsch, glossy, large-scale," "traditional, serious, matte, small-scale"
|
||||
Style: John Singer Sargent, "John Singer Sargent style {prompt} . Realistic, elegant, portrait, expressive," "abstract, casual, landscape, subdued"
|
||||
Style: Marcel Duchamp, "Marcel Duchamp style {prompt} . Dada, readymade, conceptual, controversial," "traditional, handmade, decorative, safe"
|
||||
Style: Claude Monet, "Claude Monet style {prompt} . Impressionist, outdoor, light, loose brushwork," "neoclassical, indoor, dark, tight brushwork"
|
||||
Style: Anish Kapoor, "Anish Kapoor style {prompt} . Abstract, large-scale, reflective, curved," "figurative, small-scale, matte, straight lines"
|
||||
Style: Hieronymus Bosch, "Hieronymus Bosch style {prompt} . Surrealist, detailed, religious, narrative," "realistic, abstract, secular, non-narrative"
|
||||
Style: Paul Gauguin, "Paul Gauguin style {prompt} . Post-Impressionist, exotic, bold colors, flat," "Impressionist, familiar, muted colors, volumetric"
|
||||
Style: Katsushika Hokusai, "Katsushika Hokusai style {prompt} . Ukiyo-e, nature, woodblock print, detailed," "western style, urban, oil painting, abstract"
|
||||
Style: Pierre-Auguste Renoir, "Pierre-Auguste Renoir style {prompt} . Impressionist, joyful, light, loose brushwork," "neoclassical, somber, dark, tight brushwork"
|
||||
Style: Antony Gormley, "Antony Gormley style {prompt} . Sculpture, human form, rusted, site-specific," "painting, abstract, polished, gallery-based"
|
||||
Style: Kazimir Malevich, "Kazimir Malevich style {prompt} . Suprematist, abstract, geometric, minimal," "realistic, organic, decorative, complex"
|
||||
Style: Jean-Antoine Watteau, "Jean-Antoine Watteau style {prompt} . Rococo, outdoor, elegant, lively," "Baroque, indoor, serious, static"
|
||||
Style: Constantin Brâncuși, "Constantin Brâncuși style {prompt} . Modernist, abstract, bronze, streamlined," "traditional, figurative, wood, complex"
|
||||
Style: Egon Schiele, "Egon Schiele style {prompt} . Expressionist, figure, distorted, emotional," "Impressionist, landscape, proportional, detached"
|
||||
Style: Nam June Paik, "Nam June Paik style {prompt} . Video art, technological, interactive, large-scale," "painting, traditional, static, small-scale"
|
||||
Style: James Whistler, "James Whistler style {prompt} . Tonalism, atmospheric, subdued, abstract," "Fauvism, vibrant, bold, detailed"
|
||||
Style: Wassily Kandinsky, "Wassily Kandinsky style {prompt} . Abstract, musical, geometric, vibrant," "realistic, silent, organic, subdued"
|
||||
Style: Lucio Fontana, "Lucio Fontana style {prompt} . Spatialism, monochrome, slashed, minimal," "Futurism, colorful, whole, detailed"
|
||||
Style: Artemisia Gentileschi, "Artemisia Gentileschi style {prompt} . Baroque, dramatic, biblical, female-centric," "Rococo, calm, mythological, male-centric"
|
||||
Style: Jean Dubuffet, "Jean Dubuffet style {prompt} . Art Brut, textured, primal, abstract," "Academic art, smooth, refined, realistic"
|
||||
Style: Sandro Botticelli, "Sandro Botticelli style {prompt} . Early Renaissance, mythological, linear, vibrant," "Baroque, historical, painterly, subdued"
|
||||
Style: Carl Andre, "Carl Andre style {prompt} . Minimalist, geometric, industrial, ground-level," "Baroque, organic, handcrafted, elevated"
|
||||
Style: David Hockney, "David Hockney style {prompt} . Pop art, landscape, vibrant, digital," "Abstract Expressionism, figure, subdued, traditional"
|
||||
Style: Cindy Sherman, "Cindy Sherman style {prompt} . Conceptual, self-portrait, character study, cinematic," "landscape, group portraits, candid, documentary"
|
||||
Style: Jenny Holzer, "Jenny Holzer style {prompt} . Conceptual, text-based, public, LED," "painting, image-based, private, canvas"
|
||||
Style: Dante Gabriel Rossetti, "Dante Gabriel Rossetti style {prompt} . Pre-Raphaelite, medieval, literary, romantic," "Futurist, modern, abstract, stark"
|
||||
Style: Zaha Hadid, "Zaha Hadid style {prompt} . Modernist, organic, futuristic, curved," "Classical, geometric, traditional, straight lines"
|
||||
Style: Takashi Murakami, "Takashi Murakami style {prompt} . Superflat, pop culture, colorful, cartoonish," "Cubist, high culture, monochrome, realistic"
|
||||
Style: Edward Weston, "Edward Weston style {prompt} . Photography, black and white, still life, detailed," "Painting, color, action, abstract"
|
||||
Style: Edvard Munch, "Edvard Munch style {prompt} . Expressionist, psychological, bold colors, distorted," "Impressionist, physical, muted colors, proportional"
|
||||
Style: Ai Weiwei, "Ai Weiwei style {prompt} . Contemporary, political, traditional Chinese materials, large-scale," "Classical, apolitical, modern materials, small-scale"
|
||||
Style: Georges Braque, "Georges Braque style {prompt} . Cubist, abstract, collage, muted colors," "Romantic, realistic, oil painting, vibrant colors"
|
||||
Style: Sol LeWitt, "Sol LeWitt style {prompt} . Conceptual, geometric, minimal, instructional," "Expressionist, organic, complex, spontaneous"
|
||||
Style: Mary Cassatt, "Mary Cassatt style {prompt} . Impressionist, domestic, pastel, feminine," "Realist, urban, oil, masculine"
|
||||
Style: Damien Hirst, "Damien Hirst style {prompt} . Contemporary, controversial, installation, medical," "Classical, traditional, canvas, floral"
|
||||
Style: Giuseppe Arcimboldo, "Giuseppe Arcimboldo style {prompt} . Mannerist, portrait, food, symbolic," "Cubist, landscape, abstract, literal"
|
||||
Style: Yves Klein, "Yves Klein style {prompt} . Nouveau réalisme, monochrome, blue, performance," "Pop Art, colorful, red, static"
|
||||
Style: Frida Kahlo, "Frida Kahlo style {prompt} . Surrealist, autobiographical, vibrant, symbolic," "Realist, historical, muted, literal"
|
||||
Style: Piet Mondrian, "Piet Mondrian style {prompt} . De Stijl, geometric, primary colors, balanced," "Surrealist, organic, pastel colors, chaotic"
|
||||
Style: Bridget Riley, "Bridget Riley style {prompt} . Op Art, geometric, black and white, optical," "Impressionist, organic, colorful, static"
|
||||
Style: Mark Rothko, "Mark Rothko style {prompt} . Abstract Expressionist, color field, large-scale, emotional," "Pop Art, pattern, small-scale, detached"
|
||||
Style: Joseph Beuys, "Joseph Beuys style {prompt} . Fluxus, performance, social sculpture, felt," "Minimalism, painting, object, metal"
|
||||
Style: Berthe Morisot, "Berthe Morisot style {prompt} . Impressionist, feminine, domestic, light," "Surrealist, masculine, public, dark"
|
||||
Style: Agnes Martin, "Agnes Martin style {prompt} . Minimalist, geometric, grid, subtle," "Baroque, organic, floral, bold"
|
||||
Style: Yayoi Kusama, "Yayoi Kusama style {prompt} . Contemporary, polka dots, infinity rooms, red," "Classical, plain, single room, blue"
|
||||
Style: Andy Goldsworthy, "Andy Goldsworthy style {prompt} . Environmental, temporary, nature, outdoors," "Industrial, permanent, man-made, indoors"
|
||||
Style: Henri Cartier-Bresson, "Henri Cartier-Bresson style {prompt} . Photography, decisive moment, black and white, candid," "Painting, posed, color, staged"
|
||||
Style: Marina Abramović, "Marina Abramović style {prompt} . Performance, endurance, audience participation, minimal," "Sculpture, instant, observer, complex"
|
||||
Style: Man Ray, "Man Ray style {prompt} . Dada, photography, rayograph, experimental," "Realism, painting, traditional, conventional"
|
||||
Style: Käthe Kollwitz, "Käthe Kollwitz style {prompt} . Expressionist, social realism, black and white, human suffering," "Impressionist, aestheticism, color, human joy"
|
||||
Style: Robert Rauschenberg, "Robert Rauschenberg style {prompt} . Neo-Dada, combine, mixed-media, assemblage," "Minimalism, singular material, oil painting, separated"
|
||||
Style: Lyonel Feininger, "Lyonel Feininger style {prompt} . Expressionist, Cubist, architecture, transparent," "Impressionist, organic, landscape, opaque"
|
||||
Style: Tracey Emin, "Tracey Emin style {prompt} . YBA, confessional, neon, textile," "Old Masters, universal, oil, marble"
|
||||
Style: René Magritte, "René Magritte style {prompt} . Surrealist, object, juxtaposition, mystery," "Realist, figure, relation, clarity"
|
||||
Style: Henry Moore, "Henry Moore style {prompt} . Modernist, sculpture, organic, monumental," "Classical, painting, geometric, small"
|
||||
Style: Rachel Whiteread, "Rachel Whiteread style {prompt} . Contemporary, sculpture, negative space, cast," "Traditional, drawing, positive space, sketch"
|
||||
Style: Tomma Abts, "Tomma Abts style {prompt} . Abstract, geometric, small-scale, acrylic and oil," "Figurative, organic, large-scale, watercolor"
|
||||
Style: Max Ernst, "Max Ernst style {prompt} . Surrealist, collage, frottage, dreamlike," "Realist, oil painting, brushwork, day-to-day"
|
||||
Style: Richard Serra, "Richard Serra style {prompt} . Minimalist, sculpture, corten steel, site-specific," "Baroque, painting, canvas, gallery-specific"
|
||||
Style: Ernst Ludwig Kirchner, "Ernst Ludwig Kirchner style {prompt} . Expressionist, urban, woodcut, vibrant," "Impressionist, rural, oil painting, subdued"
|
||||
Style: Eva Hesse, "Eva Hesse style {prompt} . Postminimalist, sculpture, organic, fiberglass," "Minimalist, painting, geometric, canvas"
|
||||
Style: Paul Cézanne, "Paul Cézanne style {prompt} . Post-Impressionist, still life, geometric, brushwork," "Impressionist, action, organic, smooth"
|
||||
Style: Francis Bacon, "Francis Bacon style {prompt} . Expressionist, distorted, triptych, anguish," "Classical, proportional, single panel, contentment"
|
||||
Style: Louise Bourgeois, "Louise Bourgeois style {prompt} . Contemporary, sculpture, feminist, fabric," "Classical, painting, patriarchal, oil"
|
||||
Style: Chuck Close, "Chuck Close style {prompt} . Photorealism, portrait, large-scale, gridded," "Impressionism, landscape, small-scale, loose"
|
||||
Style: Thomas Gainsborough, "Thomas Gainsborough style {prompt} . Rococo, landscape, elegant, oil," "Baroque, portrait, casual, pastel"
|
||||
Style: Gerhard Richter, "Gerhard Richter style {prompt} . Abstract, squeegee, photo-based, blurred," "Realistic, brushwork, imagination-based, detailed"
|
||||
Style: Jean-Michel Basquiat, "Jean-Michel Basquiat style {prompt} . Neo-expressionist, graffiti, crown, vibrant," "Photorealism, calligraphy, mundane, subdued"
|
||||
Style: Alexander Calder, "Alexander Calder style {prompt} . Kinetic, mobile, primary colors, balanced," "Static, statue, pastel colors, unbalanced"
|
||||
Style: Jackson Pollock, "Jackson Pollock style {prompt} . Abstract Expressionist, drip, large-scale, spontaneous," "Cubist, precise, small-scale, planned"
|
||||
Style: Anselm Kiefer, "Anselm Kiefer style {prompt} . Neo-expressionist, monumental, textured, historical," "Minimalist, small-scale, smooth, futuristic"
|
||||
Style: Amedeo Modigliani, "Amedeo Modigliani style {prompt} . Modernist, portrait, elongated, nude," "Cubist, landscape, proportional, clothed"
|
||||
Style: Gilbert & George, "Gilbert & George style {prompt} . Contemporary, photographic, duo, confrontational," "Traditional, painted, individual, pleasant"
|
||||
Style: El Greco, "El Greco style {prompt} . Mannerist, religious, elongated, dramatic," "Renaissance, secular, proportional, calm"
|
||||
Style: Salvador Dalí, "Salvador Dalí style {prompt} . Surrealist, dreamlike, precise, melting," "Realist, day-to-day, loose, solid"
|
||||
Style: Rembrandt van Rijn, "Rembrandt van Rijn style {prompt} . Baroque, self-portrait, chiaroscuro, etching," "Rococo, group portrait, bright, oil painting"
|
||||
Style: Keith Haring, "Keith Haring style {prompt} . Pop art, street art, bold lines, active figures," "Impressionism, studio art, fine brushwork, passive landscape"
|
||||
Style: Georgia O'Keeffe, "Georgia O'Keeffe style {prompt} . Modernist, flowers, close-up, sensual," "Cubist, objects, far-off, detached"
|
||||
Style: Caravaggio, "Caravaggio style {prompt} . Baroque, tenebrism, dramatic, religious," "Renaissance, bright, calm, secular"
|
||||
Style: Louise Nevelson, "Louise Nevelson style {prompt} . Abstract expressionist, sculpture, monochrome, found objects," "Realist, painting, colorful, new materials"
|
||||
Style: James Turrell, "James Turrell style {prompt} . Land art, light, immersive, perceptual," "Street art, dark, observational, intellectual"
|
||||
Style: Édouard Manet, "Édouard Manet style {prompt} . Realist, modern life, loose brushwork, controversial," "Romantic, history, fine brushwork, conventional"
|
||||
Style: Marc Chagall, "Marc Chagall style {prompt} . Surrealist, dreamlike, colorful, narrative," "Realist, day-to-day, monochrome, non-narrative"
|
||||
Style: Dan Flavin, "Dan Flavin style {prompt} . Minimalist, light, fluorescent, site-specific," "Baroque, dark, oil, gallery-specific"
|
||||
Style: Sarah Lucas, "Sarah Lucas style {prompt} . YBA, feminist, readymade, provocative," "Old Masters, masculine, handmade, conservative"
|
||||
Style: Johannes Vermeer, "Johannes Vermeer style {prompt} . Baroque, domestic, light, detailed," "Cubist, public, dark, abstract"
|
||||
Style: Tadao Ando, "Tadao Ando style {prompt} . Minimalist, concrete, light, water," "Baroque, brick, dark, dry"
|
||||
Style: Roy Lichtenstein, "Roy Lichtenstein style {prompt} . Pop art, comic strip, benday dots, primary colors," "Abstract expressionism, serious subject, brushwork, secondary colors"
|
||||
Style: Joseph Cornell, "Joseph Cornell style {prompt} . Surrealist, box, found objects, nostalgic," "Minimalist, open space, new materials, contemporary"
|
||||
Style: Gustave Courbet, "Gustave Courbet style {prompt} . Realist, rural life, coarse brushwork, controversial," "Neoclassical, noble life, fine brushwork, conventional"
|
||||
Style: Richard Long, "Richard Long style {prompt} . Land art, circle, natural materials, ephemeral," "Street art, square, synthetic materials, permanent"
|
||||
Style: Otto Dix, "Otto Dix style {prompt} . New Objectivity, war, grotesque, social critique," "Impressionism, peace, beautiful, aesthetic enjoyment"
|
||||
Style: Barnett Newman, "Barnett Newman style {prompt} . Abstract expressionism, zip, large-scale, color field," "Pop art, pattern, small-scale, comic strip"
|
||||
Style: Sophie Calle, "Sophie Calle style {prompt} . Conceptual, photography, text, personal," "Abstract, painting, brushwork, universal"
|
||||
Style: KAWS, "KAWS style {prompt} . Pop art, vinyl toy, X eyes, cartoonish," "Conceptual, bronze statue, normal eyes, realistic"
|
||||
Style: Francis Picabia, "Francis Picabia style {prompt} . Dada, machine, painting, provocative," "Impressionism, nature, sketch, pleasant"
|
||||
Style: H.R. Giger, "H.R. Giger style {prompt} . Surrealist, biomechanical, airbrush, dark," "Impressionist, human, brush, light"
|
||||
Style: Jean Arp, "Jean Arp style {prompt} . Dada, abstract, biomorphic, sculpture," "Realism, figurative, geometric, painting"
|
||||
Style: Ai Weiwei, "Ai Weiwei style {prompt} . Contemporary, political, installation, ceramics," "Renaissance, neutral, oil painting, metals"
|
||||
Style: Fernand Léger, "Fernand Léger style {prompt} . Cubist, mechanical, mural, bold colors," "Surrealist, organic, small-scale, muted colors"
|
||||
Style: Yoko Ono, "Yoko Ono style {prompt} . Conceptual, performance, instruction, peace," "Realist, still life, detailed, war"
|
||||
Style: Cindy Sherman, "Cindy Sherman style {prompt} . Contemporary, self-portrait, photography, identity," "Traditional, landscape, painting, anonymity"
|
||||
Style: Nam June Paik, "Nam June Paik style {prompt} . Video art, television, interactive, futuristic," "Traditional art, canvas, passive, historical"
|
||||
Style: Barbara Kruger, "Barbara Kruger style {prompt} . Conceptual, text, black and white, feminist," "Impressionist, image, color, patriarchal"
|
||||
Style: Piero della Francesca, "Piero della Francesca style {prompt} . Renaissance, fresco, mathematical, religious," "Contemporary, installation, random, secular"
|
||||
Style: Georgia O'Keeffe, "Georgia O'Keeffe style {prompt} . Modernist, flowers, close-up, sensual," "Cubist, objects, far-off, detached"
|
||||
Style: Richard Hamilton, "Richard Hamilton style {prompt} . Pop Art, collage, consumer culture, mixed media," "Impressionism, oil painting, rural life, single medium"
|
||||
Style: Kazimir Malevich, "Kazimir Malevich style {prompt} . Suprematism, abstract, geometric, minimal," "Realism, figurative, detailed, maximal"
|
||||
Style: Grayson Perry, "Grayson Perry style {prompt} . Contemporary, ceramics, tapestry, narrative," "Old Masters, oil painting, canvas, non-narrative"
|
||||
Style: Faith Ringgold, "Faith Ringgold style {prompt} . Contemporary, quilt, narrative, feminist," "Abstract, sculpture, non-narrative, masculine"
|
||||
Style: Banksy, "Banksy style {prompt} . Street Art, stencil, satirical, black and white," "Studio Art, oil painting, serious, color"
|
||||
Style: Tracey Emin, "Tracey Emin style {prompt} . YBA, confessional, neon, textile," "Old Masters, universal, oil, marble"
|
||||
Style: Olafur Eliasson, "Olafur Eliasson style {prompt} . Installation, light, environment, perceptual," "Painting, dark, indoors, cognitive"
|
||||
Style: Kiki Smith, "Kiki Smith style {prompt} . Feminist, body, sculpture, mythological," "Patriarchal, landscape, painting, historical"
|
||||
Style: David Hockney, "David Hockney style {prompt} . Pop Art, vibrant colors, collage, landscapes," "Abstract Expressionism, muted colors, single panel, figures"
|
||||
Style: Chris Ofili, "Chris Ofili style {prompt} . YBA, mixed-media, elephant dung, decorative," "Minimalism, single-media, clean, austere"
|
||||
Style: Ellsworth Kelly, "Ellsworth Kelly style {prompt} . Hard-edge painting, color field, minimalist, geometric," "Impressionism, detailed, ornate, organic"
|
||||
Style: Christo and Jeanne-Claude, "Christo and Jeanne-Claude style {prompt} . Installation, environmental, fabric, temporal," "Still Life, indoor, metal, permanent"
|
||||
Style: Wayne Thiebaud, "Wayne Thiebaud style {prompt} . Pop Art, still life, pastel, thick paint," "Cubism, dynamic scenes, vibrant, thin paint"
|
||||
Style: Jenny Holzer, "Jenny Holzer style {prompt} . Conceptual, text, LED, public spaces," "Realism, image, oil painting, private spaces"
|
||||
Style: Antony Gormley, "Antony Gormley style {prompt} . Sculpture, human form, rusted metal, public art," "Painting, abstract, bright colors, gallery art"
|
||||
Style: Maurice Sendak, "Maurice Sendak style {prompt} . Children's illustration, fantasy, detailed, narrative," "Abstract, adult, minimalist, non-narrative"
|
||||
>>>>>> Advanced GPT Photography
|
||||
Portrait Photography Style: Charismatic,"{prompt} with charisma. 50mm lens, f/2.8, focused on eyes, natural lighting","overexposed, underexposed, blurry, distorted, overprocessed"
|
||||
Portrait Photography Style: Cinematic,"cinematic portrait of {prompt}. 85mm lens, f/1.8, dramatic side lighting, moody atmosphere","overblown highlights, noisy, grainy, oversaturated, wide-angle distortion"
|
||||
Portrait Photography Style: Environmental,"environmental portrait of {prompt}. 35mm lens, f/4, wider context, natural surroundings","cluttered background, poor lighting, overexposed, underexposed, unsharp"
|
||||
Photojournalism Style: Reportage,"gripping reportage of {prompt}. Wide-angle lens, f/8, focus on action, capture the moment","blurred action, low light noise, unsteady shot, out of focus, distorted perspective"
|
||||
Photojournalism Style: Candid,"candid shot of {prompt}. 50mm lens, f/2.8, spontaneous, unposed","poor lighting, motion blur, out of focus, distracting background, overprocessed"
|
||||
Photojournalism Style: Documentary,"documentary style of {prompt}. 35mm lens, f/5.6, truthful representation, neutral perspective","overexposed, underexposed, oversaturated, motion blur, unsteady shot"
|
||||
Fashion Photography Style: Haute Couture,"haute couture display of {prompt}. 85mm lens, f/2.2, vibrant colors, dramatic lighting","flat lighting, out of focus, distracting background, overprocessed, oversaturated"
|
||||
Fashion Photography Style: Editorial,"editorial fashion shot of {prompt}. 50mm lens, f/2.5, storytelling, focused on outfit","unflattering pose, poor lighting, blurry, distracting elements, overexposed"
|
||||
Fashion Photography Style: Catalog,"catalog shot of {prompt}. 70mm lens, f/5.6, neutral background, clear focus on attire","poor lighting, unflattering angles, distorted perspective, underexposed, oversaturated"
|
||||
Sports Photography Style: Action-packed,"action-packed shot of {prompt}. 200mm lens, f/2.8, high shutter speed, capture the peak moment","motion blur, underexposed, out of focus, distracting background, unsteady shot"
|
||||
Sports Photography Style: Emotional,"emotional moment in {prompt}. 135mm lens, f/4, capture expressions, ambient lighting","poor focus, high ISO noise, unsteady shot, underexposed, distorted colors"
|
||||
Sports Photography Style: Narrative,"narrative image of {prompt}. 50mm lens, f/3.5, storytelling, context setting","unfocused, poor lighting, cluttered composition, overexposed, distorted perspective"
|
||||
Still Life Photography Style: Minimalistic,"minimalistic composition of {prompt}. 50mm lens, f/5.6, simplistic design, neutral colors","cluttered, oversaturated, unbalanced composition, poor lighting, overexposed"
|
||||
Still Life Photography Style: Dramatic,"dramatic still life of {prompt}. 85mm lens, f/2.2, dramatic lighting, intense colors","flat lighting, blurry, underexposed, distracting elements, oversaturated"
|
||||
Still Life Photography Style: Rustic,"rustic presentation of {prompt}. 35mm lens, f/4, natural elements, warm tones","poor focus, overexposed, cluttered, cold colors, unbalanced composition"
|
||||
Editorial Photography Style: Investigative,"investigative shot of {prompt}. 24mm lens, f/4, informative, intriguing","blurry, underexposed, distorted perspective, high ISO noise, distracting elements"
|
||||
Editorial Photography Style: Lifestyle,"lifestyle capture of {prompt}. 50mm lens, f/2.8, candid, vibrant colors","poor lighting, overprocessed, distracting background, motion blur, unsteady shot"
|
||||
Editorial Photography Style: Opinion,"opinion image of {prompt}. 35mm lens, f/5.6, emotive, storytelling","poor focus, underexposed, cluttered composition, overexposed highlights, distorted colors"
|
||||
Architectural Photography Style: Historical,"historical capture of {prompt}. 24mm lens, f/8, capture architectural details, natural lighting","distorted perspective, underexposed, overprocessed, unsharp, oversaturated"
|
||||
Architectural Photography Style: Modernist,"modernist view of {prompt}. 18mm lens, f/4, minimalistic, strong lines","barrel distortion, overexposed, blurry, poor composition, flat colors"
|
||||
Architectural Photography Style: Surreal,"surreal perspective of {prompt}. Fisheye lens, f/2.8, abstract interpretation, vibrant colors","unfocused, poor lighting, underexposed, overprocessed, distracting elements"
|
||||
>>>>>> GPT Painting Styles
|
||||
Style: Steampunk,"steampunk-inspired {prompt} . gears, brass, rivets, old-world technology, intricate, highly detailed, Victorian,"ugly, deformed, noisy, blurry, minimalistic, sleek"
|
||||
Style: Futuristic,"futuristic interpretation of {prompt} . sleek, high-tech, metallic, smooth surfaces, neon, sharp edges, crystal clear, professional, ultra detailed,"ugly, deformed, noisy, blurry, rustic, vintage, antique"
|
||||
Style: Abstract Expressionism,"Abstract Expressionist style of {prompt} . bold colors, vigorous brushwork, non-representational, spontaneous, expressive, emotional,"boring, monotone, plain, still, unemotional, realistic, photographic"
|
||||
Style: Surrealism,"surrealistic {prompt} . dreamlike, subconscious, bizarre, highly detailed, intricate, imaginative, illogical juxtaposition,"clear, realistic, boring, typical, straightforward, concrete, photographic"
|
||||
Style: Watercolor,"watercolor painting of {prompt} . fluid, soft edges, light colors, translucent, delicate, dreamy,"hard, geometric, precise, opaque, harsh, dark, sharp, digital, pixelated"
|
||||
Style: Pointillism,"pointillist technique on {prompt} . tiny dots of color, optical blend, detailed, vibrant, rich,"solid, monochromatic, bland, minimalist, soft, blurry"
|
||||
Style: Cubism,"cubist interpretation of {prompt} . geometric forms, multi-perspective, abstract, fragmented, complex,"rounded, realistic, photographic, simple, straightforward, traditional"
|
||||
Style: Gothic,"gothic style {prompt} . dark, mysterious, medieval, ornate, intricate, detailed, haunting,"bright, modern, simple, minimalist, cheerful, photorealistic"
|
||||
Style: Pop Art,"pop art style {prompt} . bold colors, mass culture, comic style, ironical, vibrant, detailed,"neutral, realistic, serious, dull, monochromatic, photographic"
|
||||
Style: Impressionism,"impressionist take on {prompt} . loose brushwork, light color, emphasis on light and movement, emotive, painterly,"tight, photographic, dark, stationary, unemotional, sharp, digital"
|
||||
Style: Street Art,"street art version of {prompt} . urban, graffiti, spray paint, vibrant, bold, rough, rebellious,"elegant, refined, traditional, delicate, soft, photorealistic"
|
||||
Style: Art Nouveau,"art nouveau style {prompt} . elegant, ornate, flowing lines, detailed, decorative,"simple, modern, sharp, minimalistic, geometric, unadorned"
|
||||
Style: Charcoal,"charcoal sketch of {prompt} . dark, grainy, high contrast, loose, dramatic,"light, smooth, precise, colorful, clean, photographic"
|
||||
Style: Collage,"collage of {prompt} . mixed media, eclectic, detailed, layered, creative,"uniform, minimalistic, simple, clean, digital, monochromatic"
|
||||
Style: Minimalist,"minimalist {prompt} . clean lines, simple shapes, limited color palette, modern, sleek,"detailed, ornate, decorative, colorful, chaotic, complex"
|
||||
Style: Graffiti,"graffiti style {prompt} . street art, bold, colorful, vibrant, dynamic, urban, rebellious, intricate,"refined, subtle, soft, elegant, traditional, photorealistic"
|
||||
Style: Trompe L'oeil,"trompe l'oeil of {prompt} . hyperrealistic, 3d illusion, detailed, deceptive, intricate,"abstract, flat, simple, symbolic, unrealistic, distorted"
|
||||
Style: Fauvism,"fauvist interpretation of {prompt} . wild brushwork, vibrant color, expressive, bold, emotive, painterly,"neutral, precise, calm, realistic, photographic, subdued"
|
||||
Style: Hyperrealism,"hyperrealistic {prompt} . photorealistic, extreme detail, lifelike, crisp, precise,"blurry, abstract, loose, impressionistic, simple, symbolic"
|
||||
Style: Dada,"dadaist version of {prompt} . anti-art, absurd, random, satirical, mixed media, collage,"traditional, sensible, serious, realistic, photorealistic"
|
||||
Style: Calligraphy,"calligraphy style {prompt} . elegant, flowing, precise, detailed, intricate, hand-drawn,"bold, blocky, geometric, rough, digital, simple"
|
||||
Style: Baroque,"baroque rendition of {prompt} . opulent, grand, ornate, dramatic, detailed, decorative,"minimalist, modern, simple, clean, unadorned, geometric"
|
||||
Style: Op Art,"op art style {prompt} . optical illusion, geometric, vibrant, dynamic, detailed, bold,"soft, organic, loose, subdued, simple, unpatterned"
|
||||
Style: Psychedelic,"psychedelic version of {prompt} . vibrant color, distorted visuals, swirling patterns, trippy, detailed, intricate,"neutral, realistic, orderly, simple, clear, photorealistic"
|
||||
Style: Scratchboard,"scratchboard technique on {prompt} . contrast, engraved, black and white, detailed, dramatic,"colorful, soft, loose, blended, photorealistic"
|
||||
Style: Botanical Illustration,"botanical illustration of {prompt} . detailed, accurate, precise, delicate, naturalistic,"abstract, loose, imprecise, bold, exaggerated, symbolic"
|
||||
Style: Lithography,"lithograph of {prompt} . printmaking, smooth, detailed, bold, graphic,"rough, textured, loose, brushy, three dimensional"
|
||||
Style: Mosaic,"mosaic of {prompt} . tiled, geometric, vibrant, intricate, decorative,"soft, organic, loose, simple, smooth, unpatterned"
|
||||
Style: Woodcut,"woodcut style {prompt} . carved, bold lines, high contrast, rustic, handmade,"smooth, soft, delicate, digital, photorealistic"
|
||||
Style: Stencil Art,"stencil art of {prompt} . sharp edges, bold, graphic, street art style, vibrant,"soft, loose, organic, brushy, traditional"
|
||||
Style: Rotoscoping,"rotoscoped {prompt} . traced, animation style, smooth, realistic, detailed,"abstract, symbolic, rough, loose, blocky"
|
||||
Style: Glass Painting,"glass painting of {prompt} . translucent, vibrant, decorative, intricate, glossy,"matte, dull, loose, rough, opaque"
|
||||
Style: Art Deco,"art deco interpretation of {prompt} . geometric, bold, symmetrical, ornate, detailed, decorative,"soft, organic, asymmetrical, minimalist, simple"
|
||||
Style: Hard Edge Painting,"hard edge painting of {prompt} . geometric, sharp edges, flat color, modern, bold,"soft, organic, loose, textured, detailed, photorealistic"
|
||||
Style: Drybrush,"drybrush technique on {prompt} . rough texture, loose brushwork, subtle detail, expressive, painterly,"smooth, precise, clean, detailed, photorealistic"
|
||||
Style: Silhouette,"silhouette of {prompt} . high contrast, dramatic, simple, bold, graphic,"detailed, textured, colorful, light, photorealistic"
|
||||
Style: Plein Air,"plein air painting of {prompt} . outdoor, natural light, vibrant, loose, expressive,"studio, artificial, precise, tight, clean, photorealistic"
|
||||
Style: Ink Wash,"ink wash painting of {prompt} . monochromatic, loose, fluid, expressive, delicate,"colorful, tight, dry, bold, detailed, photorealistic"
|
||||
Style: Body Painting,"body painting of {prompt} . human canvas, vibrant, detailed, transformative, expressive,"traditional canvas, subtle, clean, realistic, monochromatic"
|
||||
Style: Spray Paint,"spray paint art of {prompt} . street style, vibrant, spontaneous, bold, rough,"refined, soft, delicate, precise, clean, photorealistic"
|
||||
Style: Grisaille,"grisaille painting of {prompt} . monochromatic, detailed, realistic, refined, tonal,"colorful, abstract, loose, impressionistic, simple"
|
||||
Style: Stippling,"stippled technique on {prompt} . dotted, texture, detailed, graphic, intricate,"smooth, solid, loose, brushy, blended"
|
||||
Style: Pastel,"pastel drawing of {prompt} . soft, colorful, delicate, expressive, textured,"sharp, bold, clean, precise, digital"
|
||||
Style: Encaustic,"encaustic painting of {prompt} . wax, textured, layered, luminous, rich,"flat, smooth, simple, clean, dry, photorealistic"
|
||||
Style: Macrame,"macrame style {prompt} . knotted, textile, intricate, handmade, decorative,"smooth, flat, hard, precise, digital"
|
||||
Style: Graffiti Stencil,"graffiti stencil art of {prompt} . urban, bold, vibrant, street style, graphic,"elegant, refined, soft, traditional, photorealistic"
|
||||
Style: Action Painting,"action painting of {prompt} . spontaneous, energetic, abstract, expressive, bold,"precise, slow, realistic, photographic, unemotional"
|
||||
Style: Batik,"batik style {prompt} . dyed, vibrant, patterned, textile, decorative,"plain, unpatterned, hard, smooth, clean, digital"
|
||||
Style: Folk Art,"folk art depiction of {prompt} . traditional, handmade, decorative, vibrant, detailed,"modern, digital, simple, clean, minimalistic"
|
||||
Style: Glitch Art,"glitch art of {prompt} . distorted, digital, vibrant, abstract, modern,"refined, traditional, realistic, photographic, unaltered"
|
||||
Style: Chiaroscuro,"chiaroscuro technique on {prompt} . high contrast, dramatic, realistic, refined, tonal,"flat, dull, abstract, impressionistic, simple"
|
||||
Style: Gouache,"gouache painting of {prompt} . vibrant, opaque, smooth, rich, detailed,"transparent, loose, rough, dull, photorealistic"
|
||||
>>>>>> GPT Instagram Styles
|
||||
Style: High-Fashion, "{prompt} in haute couture. Luxury, designer brands, runway-ready, tailored, chic", "casual, sporty, laid-back, street style, loose"
|
||||
Style: Casual-Chic, "{prompt} in a casual chic outfit. Comfortable, stylish, modern, accessible", "formal, high fashion, flamboyant, extravagant"
|
||||
Style: Streetwear, "{prompt} rocking the streetwear trend. Urban, hip-hop influence, sneakers, caps, oversized", "preppy, conservative, formal, traditional"
|
||||
Style: Athletic, "{prompt} in athletic wear. Sporty, gym-ready, functional, sneakers, activewear", "evening wear, formal, business, relaxed"
|
||||
Style: Vintage, "{prompt} in a vintage ensemble. Retro, nostalgia, classic styles, second-hand", "modern, futuristic, minimalist, new"
|
||||
Style: Bohemian, "{prompt} in boho fashion. Free-spirited, layered, patterns, ethnic-inspired, fringe", "minimalist, structured, monochromatic, sleek"
|
||||
Style: Minimalist, "{prompt} sporting minimalist fashion. Simple, clean lines, neutral colors, unfussy", "vintage, boho, flamboyant, colorful"
|
||||
Style: Preppy, "{prompt} dressed in preppy style. Collegiate, clean-cut, conservative, layered", "gothic, punk, casual, relaxed"
|
||||
Style: Gothic, "{prompt} in a gothic getup. Dark, leather, lace, Victorian influence", "preppy, pastel, boho, bright"
|
||||
Style: Punk, "{prompt} with a punk look. Rebellious, grungy, band tees, ripped denim", "preppy, classic, conservative, formal"
|
||||
Style: Grunge, "{prompt} sporting a grunge look. '90s influence, flannel, band tees, distressed", "preppy, glamorous, feminine, tailored"
|
||||
Style: Glamorous, "{prompt} looking glamorous. Luxury, sequins, fur, red carpet ready", "casual, relaxed, sporty, minimalist"
|
||||
Style: Rocker, "{prompt} rocking the rock style. Leather, band tees, edgy, black", "preppy, pastel, boho, cute"
|
||||
Style: Hipster, "{prompt} in a hipster outfit. Eclectic, indie, non-mainstream, vintage", "mainstream, sporty, glamorous, preppy"
|
||||
Style: Ethical, "{prompt} wearing ethical fashion. Sustainable, fair trade, organic materials, eco-friendly", "fast fashion, synthetic, mass-produced, cheap"
|
||||
Style: Business Casual, "{prompt} dressed in business casual. Semi-formal, tailored, smart, professional", "sporty, casual, grunge, punk"
|
||||
Style: Beachwear, "{prompt} in beachwear. Bikinis, cover-ups, sandals, straw hats, light fabrics", "winter wear, formal, business, structured"
|
||||
Style: Activewear, "{prompt} in stylish activewear. Sporty, comfortable, functional, athleisure", "evening wear, formal, preppy, boho"
|
||||
Style: Country, "{prompt} sporting country style. Western, cowboy boots, plaid, denim", "gothic, punk, high fashion, glamorous"
|
||||
Style: Military, "{prompt} wearing military-inspired fashion. Camouflage, khaki, structured, badges", "boho, glamorous, preppy, beachwear"
|
||||
Style: Kawaii, "{prompt} in Kawaii style. Cute, pastel, girly, anime-inspired, frilly", "gothic, punk, grunge, minimalist"
|
||||
Style: Lolita, "{prompt} in a Lolita ensemble. Victorian-inspired, frilly, bows, lace, layered", "minimalist, sporty, casual, business"
|
||||
Style: Formal, "{prompt} dressed in formal wear. Black tie, tuxedo, evening gown, polished", "casual, sporty, grunge, beachwear"
|
||||
Style: Tomboy, "{prompt} rocking a tomboy look. Androgynous, loose, sneakers, caps", "glamorous, feminine, boho, preppy"
|
||||
Style: Normcore, "{prompt} dressed in normcore. Unpretentious, casual, basics, comfortable", "high fashion, glamorous, punk, gothic"
|
||||
Style: Artistic, "{prompt} in an artistic outfit. Creative, unique, expressive, handmade", "preppy, conservative, business, traditional"
|
||||
Style: Genderless, "{prompt} in genderless fashion. Androgynous, neutral, modern, unisex", "feminine, masculine, glam, preppy"
|
||||
Style: Monochromatic, "{prompt} in a monochromatic look. Single color, sleek, modern, minimalist", "colorful, vibrant, patterned, boho"
|
||||
Style: Mod, "{prompt} dressed in Mod style. '60s influence, A-line, geometric patterns, bold", "boho, grunge, minimalist, normcore"
|
||||
Style: Harajuku, "{prompt} in Harajuku style. Japanese street fashion, eclectic, colorful, anime", "conservative, preppy, minimalist, business"
|
||||
Style: Cyberpunk, "{prompt} in a cyberpunk outfit. Futuristic, dystopian, metallic, neon", "vintage, retro, classic, boho"
|
||||
Style: Rave, "{prompt} in rave wear. Bright colors, neon, sequins, fur", "business casual, preppy, conservative, minimalist"
|
||||
Style: Hippy, "{prompt} in hippy style. '70s influence, tie-dye, bell-bottoms, fringe", "preppy, conservative, formal, modern"
|
||||
Style: Skater, "{prompt} rocking skater style. Casual, sneakers, baggy, sporty, laid-back", "formal, glamorous, high fashion, preppy"
|
||||
Style: Pin-Up, "{prompt} in a pin-up style. Retro, '50s influence, feminine, curves", "gothic, grunge, sporty, tomboy"
|
||||
Style: Nautical, "{prompt} in a nautical outfit. Sailor-inspired, stripes, navy, white, red", "gothic, punk, grunge, boho"
|
||||
Style: Futuristic, "{prompt} in futuristic fashion. Metallic, geometric, avant-garde, high-tech", "vintage, classic, traditional, retro"
|
||||
Style: Eccentric, "{prompt} in an eccentric ensemble. Unique, quirky, stand-out, individualistic", "traditional, classic, conservative, minimalist"
|
||||
Style: Tailored, "{prompt} in a tailored suit. Formal, professional, sleek, well-fitted", "casual, relaxed, oversized, loose"
|
||||
Style: Sustainable, "{prompt} in sustainable fashion. Eco-friendly, organic, recycled materials, fair trade", "fast fashion, synthetic, cheap, disposable"
|
||||
Style: Traditional, "{prompt} in a traditional outfit. Ethnic, regional, cultural, heritage", "modern, futuristic, western, mainstream"
|
||||
Style: Candid, "{prompt} captured in a candid moment. Unposed, natural, spontaneous, real-life situation", "posed, artificial, studio shot, planned"
|
||||
Style: Portrait, "portrait shot of {prompt}. Close-up, eyes on camera, clear, sharp", "wide shot, landscape, blurred, candid"
|
||||
Style: Lifestyle, "lifestyle photo of {prompt}. Everyday activities, real-life situations, relatable", "fantasy, staged, surreal, unrealistic"
|
||||
Style: Editorial, "editorial shot of {prompt}. Fashion-forward, styled, professional, magazine-ready", "casual, candid, unstyled, amateur"
|
||||
Style: Glamour, "glamour shot of {prompt}. Beauty focused, make-up, lighting, seductive", "natural, minimal, candid, unglamorous"
|
||||
Style: Fitness, "fitness photo of {prompt}. Athletic, workout gear, active, strong", "laid back, casual, non-athletic, inactive"
|
||||
Style: Boudoir, "boudoir shot of {prompt}. Intimate, sensual, classy, tasteful", "public, conservative, modest, non-intimate"
|
||||
Style: Silhouette, "silhouette photo of {prompt}. Dramatic, backlighting, mysterious, creative", "frontlit, clear, detailed, revealing"
|
||||
Style: Maternity, "maternity shot of {prompt}. Pregnancy, baby bump, motherhood, glowing", "non-pregnant, childless, pre-pregnancy, post-pregnancy"
|
||||
Style: Black and White, "black and white photo of {prompt}. Monochrome, timeless, artistic, dramatic", "color, vibrant, modern, digital"
|
||||
Style: Pin-Up, "pin-up style photo of {prompt}. Retro, feminine, seductive, fun", "modern, conservative, modest, non-vintage"
|
||||
Style: Headshot, "headshot of {prompt}. Professional, clear, neutral background, focused", "full body, casual, distracting background, unfocused"
|
||||
Style: Full Body, "full body shot of {prompt}. Whole outfit, clear, sharp, balanced", "close up, cropped, blurry, unbalanced"
|
||||
Style: High Fashion, "high fashion photo of {prompt}. Designer clothes, dramatic poses, avant-garde", "casual, candid, natural, mainstream fashion"
|
||||
Style: Business, "business photo of {prompt}. Professional attire, workplace setting, confident", "casual, relaxed, non-work, insecure"
|
||||
Style: Beach, "beach photo of {prompt}. Swimwear, sand, ocean, relaxed", "urban, winter, formal, stressed"
|
||||
Style: Lingerie, "lingerie shot of {prompt}. Intimate apparel, sensual, feminine, seductive", "outerwear, modest, masculine, non-sensual"
|
||||
Style: Athletic, "athletic shot of {prompt}. Sportswear, action, energy, strength", "leisure, inactive, weak, non-sporty"
|
||||
Style: Close-up, "close-up photo of {prompt}. Detailed, intimate, clear, personal", "wide shot, distant, blurry, impersonal"
|
||||
Style: Nature, "nature shot with {prompt}. Outdoors, greenery, natural light, fresh", "indoor, city, artificial light, stale"
|
||||
Style: Studio, "studio shot of {prompt}. Controlled lighting, plain background, clear", "outdoor, natural light, busy background, unclear"
|
||||
Style: Street, "street shot of {prompt}. Urban, casual, candid, trendy", "rural, formal, posed, traditional"
|
||||
Style: Dance, "dance photo of {prompt}. Movement, grace, energy, rhythm", "static, clumsy, lethargic, off-beat"
|
||||
Style: Vintage, "vintage style photo of {prompt}. Retro, nostalgic, old-fashioned, timeless", "modern, futuristic, trendy, transient"
|
||||
Style: Low Light, "low light photo of {prompt}. Ambient, moody, dramatic, shadowy", "bright, cheerful, flat, clear"
|
||||
Style: Underwater, "underwater photo of {prompt}. Aquatic, serene, dreamlike, floaty", "land, hectic, realistic, heavy"
|
||||
Style: Action, "action shot of {prompt}. Movement, energy, dynamic, intense", "still, calm, static, gentle"
|
||||
Style: Fashion, "fashion shot of {prompt}. Trendy outfit, styled, runway-ready, chic", "plain, unstyled, out of style, ordinary"
|
||||
Style: Aerial, "aerial shot of {prompt}. Birds-eye view, grand, adventurous, stunning", "ground level, confined, cautious, underwhelming"
|
||||
Style: Music, "music-related shot of {prompt}. Playing an instrument, singing, energetic, passionate", "quiet, uninterested, uninvolved, lackluster"
|
||||
Style: Abstract, "abstract photo of {prompt}. Artistic, unique, creative, unconventional", "concrete, literal, conventional, uncreative"
|
||||
Style: Fine Art, "fine art photo of {prompt}. Conceptual, creative, artistic, aesthetic", "commercial, literal, uncreative, unaesthetic"
|
||||
Style: Cityscape, "cityscape shot with {prompt}. Urban, skyline, architectural, dynamic", "rural, landscape, natural, static"
|
||||
Style: Landscape, "landscape shot with {prompt}. Scenic, outdoors, grand, beautiful", "indoor, close-up, confined, unattractive"
|
||||
Style: Macro, "macro shot of {prompt}. Extremely close-up, detailed, intricate, revealing", "wide shot, undetailed, simple, concealing"
|
||||
Style: Golden Hour, "golden hour shot of {prompt}. Warm light, sunset/sunrise, magical, serene", "midday, harsh light, mundane, agitated"
|
||||
Style: Blue Hour, "blue hour shot of {prompt}. Cool light, twilight, peaceful, moody", "midday, harsh light, chaotic, flat"
|
||||
Style: Night, "night shot of {prompt}. Dark, lit, moody, mysterious", "daytime, bright, cheerful, clear"
|
||||
Style: Reflection, "reflection shot of {prompt}. Mirror image, symmetry, creative, thoughtful", "direct, asymmetrical, uncreative, thoughtless"
|
||||
Style: Backlit, "backlit photo of {prompt}. Silhouette, dramatic, artistic, shadowy", "frontlit, flat, unartistic, clear"
|
||||
Style: Overhead, "overhead shot of {prompt}. Top-down view, unique perspective, revealing", "low angle, ordinary perspective, concealing"
|
||||
|
Can't render this file because it contains an unexpected character in line 171 and column 80.
|
+10
-33
@@ -261,6 +261,16 @@ export function inner_value_change(widget, val, event = undefined) {
|
||||
}
|
||||
}
|
||||
|
||||
export const getNamedWidget = (node, ...names) => {
|
||||
const out = {}
|
||||
|
||||
for (const name of names) {
|
||||
out[name] = node.widgets.find((w) => w.name === name)
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {LGraphNode} node
|
||||
* @param {LLink} link
|
||||
@@ -631,39 +641,6 @@ export const loadScript = (
|
||||
})
|
||||
}
|
||||
|
||||
export function defineClass(className, classStyles) {
|
||||
const styleSheets = document.styleSheets
|
||||
|
||||
// Helper function to check if the class exists in a style sheet
|
||||
function classExistsInStyleSheet(styleSheet) {
|
||||
const rules = styleSheet.rules || styleSheet.cssRules
|
||||
for (const rule of rules) {
|
||||
if (rule.selectorText === `.${className}`) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Check if the class is already defined in any of the style sheets
|
||||
let classExists = false
|
||||
for (const styleSheet of styleSheets) {
|
||||
if (classExistsInStyleSheet(styleSheet)) {
|
||||
classExists = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// If the class doesn't exist, add the new class definition to the first style sheet
|
||||
if (!classExists) {
|
||||
if (styleSheets[0].insertRule) {
|
||||
styleSheets[0].insertRule(`.${className} { ${classStyles} }`, 0)
|
||||
} else if (styleSheets[0].addRule) {
|
||||
styleSheets[0].addRule(`.${className}`, classStyles, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region documentation widget
|
||||
|
||||
+13
-3
@@ -81,7 +81,7 @@ app.registerExtension({
|
||||
}
|
||||
|
||||
const onExecuted = nodeType.prototype.onExecuted
|
||||
nodeType.prototype.onExecuted = function (data) {
|
||||
nodeType.prototype.onExecuted = async function (data) {
|
||||
onExecuted?.apply(this, arguments)
|
||||
|
||||
const prefix = 'anything_'
|
||||
@@ -95,7 +95,6 @@ app.registerExtension({
|
||||
this.widgets.length = 1
|
||||
}
|
||||
let widgetI = 1
|
||||
// console.log(message)
|
||||
if (data.text) {
|
||||
for (const txt of data.text) {
|
||||
const w = this.addCustomWidget(
|
||||
@@ -115,11 +114,22 @@ app.registerExtension({
|
||||
}
|
||||
}
|
||||
|
||||
if (data.geometry) {
|
||||
for (const geom of data.geometry) {
|
||||
console.log('Adding geom', geom, typeof geom)
|
||||
const w = this.addCustomWidget(
|
||||
await MtbWidgets.DEBUG_GEOM(this, `${prefix}_${widgetI}`, geom),
|
||||
)
|
||||
w.parent = this
|
||||
widgetI++
|
||||
}
|
||||
}
|
||||
|
||||
// this.setSize(this.computeSize())
|
||||
|
||||
this.onRemoved = function () {
|
||||
// When removing this node we need to remove the input from the DOM
|
||||
for (let y in this.widgets) {
|
||||
for (const y in this.widgets) {
|
||||
if (this.widgets[y].canvas) {
|
||||
this.widgets[y].canvas.remove()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* File: geometry_nodes.js
|
||||
* Project: comfy_mtb
|
||||
* Author: Mel Massadian
|
||||
*
|
||||
* Copyright (c) 2023 Mel Massadian
|
||||
*
|
||||
*/
|
||||
|
||||
import { app } from '../../scripts/app.js'
|
||||
|
||||
app.registerExtension({
|
||||
name: 'mtb.geometry_nodes',
|
||||
init: () => {},
|
||||
|
||||
async beforeRegisterNodeDef(nodeType, nodeData, ...args) {
|
||||
switch (nodeData.name) {
|
||||
case 'Geometry Load (mtb)': {
|
||||
const onExecuted = nodeType.prototype.onExecuted
|
||||
nodeType.prototype.onExecuted = function (message) {
|
||||
onExecuted?.apply(this, nodeType, nodeData, ...args)
|
||||
console.log('Executed Load Geometry', ...args)
|
||||
console.log('Message:', message)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
+296
-295
@@ -13,40 +13,40 @@ import { api } from '../../scripts/api.js'
|
||||
import { app } from '../../scripts/app.js'
|
||||
import { LocalStorageManager } from './comfy_shared.js'
|
||||
const styles = {
|
||||
lighbox: {
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: '100vw',
|
||||
height: '100vh',
|
||||
background: 'rgba(0,0,0,0.5)',
|
||||
display: 'none',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
zIndex: 999,
|
||||
},
|
||||
lightboxBtn: (extra) => ({
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
color: '#fff',
|
||||
zIndex: 1000,
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
pointerEvents: 'auto',
|
||||
...extra,
|
||||
}),
|
||||
img_list: {
|
||||
minHeight: '30px',
|
||||
maxHeight: '300px',
|
||||
width: '100vw',
|
||||
position: 'absolute',
|
||||
bottom: 0,
|
||||
zIndex: 10,
|
||||
background: '#333',
|
||||
overflow: 'auto',
|
||||
},
|
||||
lighbox: {
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: '100vw',
|
||||
height: '100vh',
|
||||
background: 'rgba(0,0,0,0.5)',
|
||||
display: 'none',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
zIndex: 999,
|
||||
},
|
||||
lightboxBtn: (extra) => ({
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
color: '#fff',
|
||||
zIndex: 1000,
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
pointerEvents: 'auto',
|
||||
...extra,
|
||||
}),
|
||||
img_list: {
|
||||
minHeight: '30px',
|
||||
maxHeight: '300px',
|
||||
width: '100vw',
|
||||
position: 'absolute',
|
||||
bottom: 0,
|
||||
zIndex: 10,
|
||||
background: '#333',
|
||||
overflow: 'auto',
|
||||
},
|
||||
}
|
||||
|
||||
let currentImageIndex = 0
|
||||
@@ -58,298 +58,299 @@ const storage = new LocalStorageManager('mtb')
|
||||
let activated = storage.get('image_feed', false)
|
||||
|
||||
app.registerExtension({
|
||||
name: 'mtb.ImageFeed',
|
||||
setup: () => {
|
||||
app.ui.settings.addSetting({
|
||||
id: 'mtb.imageFeed.enabled',
|
||||
name: '[⚡mtb] Enable image feed',
|
||||
type: 'boolean',
|
||||
defaultValue: true,
|
||||
attrs: {
|
||||
style: {
|
||||
fontFamily: 'monospace',
|
||||
},
|
||||
},
|
||||
async onChange(value) {
|
||||
storage.set('image_feed', value)
|
||||
activated = value
|
||||
},
|
||||
})
|
||||
},
|
||||
init: async () => {
|
||||
if (!activated) {
|
||||
return
|
||||
}
|
||||
const pythongossFeed = app.extensions.find(
|
||||
(e) => e.name === 'pysssss.ImageFeed',
|
||||
)
|
||||
if (pythongossFeed) {
|
||||
console.warn(
|
||||
"[mtb] - Aborting the loading of mtb's imageFeed in favor of pysssss.ImageFeed",
|
||||
)
|
||||
activated = false // just in case other methods are added later on
|
||||
return
|
||||
}
|
||||
// - HTML & CSS
|
||||
//- lightbox
|
||||
const lightboxContainer = document.createElement('div')
|
||||
Object.assign(lightboxContainer.style, styles.lighbox)
|
||||
name: 'mtb.ImageFeed',
|
||||
setup: () => {
|
||||
app.ui.settings.addSetting({
|
||||
id: 'mtb.Main.image-feed-enabled',
|
||||
category: ['mtb', 'Main', 'image-feed-enabled'],
|
||||
name: 'Enable Image Feed',
|
||||
type: 'boolean',
|
||||
defaultValue: false,
|
||||
attrs: {
|
||||
style: {
|
||||
fontFamily: 'monospace',
|
||||
},
|
||||
},
|
||||
async onChange(value) {
|
||||
storage.set('image_feed', value)
|
||||
activated = value
|
||||
},
|
||||
})
|
||||
},
|
||||
init: async () => {
|
||||
if (!activated) {
|
||||
return
|
||||
}
|
||||
const pythongossFeed = app.extensions.find(
|
||||
(e) => e.name === 'pysssss.ImageFeed',
|
||||
)
|
||||
if (pythongossFeed) {
|
||||
console.warn(
|
||||
"[mtb] - Aborting the loading of mtb's imageFeed in favor of pysssss.ImageFeed",
|
||||
)
|
||||
activated = false // just in case other methods are added later on
|
||||
return
|
||||
}
|
||||
// - HTML & CSS
|
||||
//- lightbox
|
||||
const lightboxContainer = document.createElement('div')
|
||||
Object.assign(lightboxContainer.style, styles.lighbox)
|
||||
|
||||
const lightboxImage = document.createElement('img')
|
||||
Object.assign(lightboxImage.style, {
|
||||
maxHeight: '100%',
|
||||
maxWidth: '100%',
|
||||
borderRadius: '5px',
|
||||
})
|
||||
const lightboxImage = document.createElement('img')
|
||||
Object.assign(lightboxImage.style, {
|
||||
maxHeight: '100%',
|
||||
maxWidth: '100%',
|
||||
borderRadius: '5px',
|
||||
})
|
||||
|
||||
// previous and next buttons
|
||||
const lightboxPrevBtn = document.createElement('button')
|
||||
const lightboxNextBtn = document.createElement('button')
|
||||
// previous and next buttons
|
||||
const lightboxPrevBtn = document.createElement('button')
|
||||
const lightboxNextBtn = document.createElement('button')
|
||||
|
||||
lightboxPrevBtn.textContent = '❮'
|
||||
lightboxNextBtn.textContent = '❯'
|
||||
lightboxPrevBtn.textContent = '❮'
|
||||
lightboxNextBtn.textContent = '❯'
|
||||
|
||||
Object.assign(lightboxPrevBtn.style, styles.lightboxBtn({ left: '0%' }))
|
||||
Object.assign(lightboxNextBtn.style, styles.lightboxBtn({ right: '0%' }))
|
||||
Object.assign(lightboxPrevBtn.style, styles.lightboxBtn({ left: '0%' }))
|
||||
Object.assign(lightboxNextBtn.style, styles.lightboxBtn({ right: '0%' }))
|
||||
|
||||
// close button
|
||||
const lightboxCloseBtn = document.createElement('button')
|
||||
Object.assign(
|
||||
lightboxCloseBtn.style,
|
||||
styles.lightboxBtn({ right: '0', top: '0' }),
|
||||
)
|
||||
lightboxCloseBtn.textContent = '❌'
|
||||
// close button
|
||||
const lightboxCloseBtn = document.createElement('button')
|
||||
Object.assign(
|
||||
lightboxCloseBtn.style,
|
||||
styles.lightboxBtn({ right: '0', top: '0' }),
|
||||
)
|
||||
lightboxCloseBtn.textContent = '❌'
|
||||
|
||||
const lightboxButtons = document.createElement('div')
|
||||
Object.assign(lightboxButtons.style, {
|
||||
position: 'absolute',
|
||||
top: '0%',
|
||||
right: '0%',
|
||||
// transform: "translate(50%, -50%)",
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
color: '#fff',
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
pointerEvents: 'none',
|
||||
})
|
||||
const lightboxButtons = document.createElement('div')
|
||||
Object.assign(lightboxButtons.style, {
|
||||
position: 'absolute',
|
||||
top: '0%',
|
||||
right: '0%',
|
||||
// transform: "translate(50%, -50%)",
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
color: '#fff',
|
||||
fontSize: '30px',
|
||||
cursor: 'pointer',
|
||||
pointerEvents: 'none',
|
||||
})
|
||||
|
||||
lightboxButtons.append(lightboxPrevBtn, lightboxNextBtn, lightboxCloseBtn)
|
||||
lightboxContainer.append(lightboxButtons, lightboxImage)
|
||||
lightboxButtons.append(lightboxPrevBtn, lightboxNextBtn, lightboxCloseBtn)
|
||||
lightboxContainer.append(lightboxButtons, lightboxImage)
|
||||
|
||||
//- image list
|
||||
const imageListContainer = document.createElement('div')
|
||||
Object.assign(imageListContainer.style, styles.img_list)
|
||||
//- image list
|
||||
const imageListContainer = document.createElement('div')
|
||||
Object.assign(imageListContainer.style, styles.img_list)
|
||||
|
||||
const createImgListBtn = (text, style) => {
|
||||
const btn = document.createElement('button')
|
||||
btn.type = 'button'
|
||||
btn.textContent = text
|
||||
Object.assign(btn.style, {
|
||||
...style,
|
||||
border: 'none',
|
||||
color: '#fff',
|
||||
background: 'none',
|
||||
height: '20px',
|
||||
cursor: 'pointer',
|
||||
position: 'absolute',
|
||||
top: '5px',
|
||||
fontSize: '12px',
|
||||
lineHeight: '12px',
|
||||
})
|
||||
imageListContainer.append(btn)
|
||||
return btn
|
||||
}
|
||||
const showBtn = document.createElement('button')
|
||||
const closeBtn = createImgListBtn('❌', {
|
||||
width: '20px',
|
||||
textIndent: '-4px',
|
||||
right: '5px',
|
||||
})
|
||||
const loadButton = createImgListBtn('Load Session History', {
|
||||
right: '90px',
|
||||
})
|
||||
const clearButton = createImgListBtn('Clear', {
|
||||
right: '30px',
|
||||
})
|
||||
const createImgListBtn = (text, style) => {
|
||||
const btn = document.createElement('button')
|
||||
btn.type = 'button'
|
||||
btn.textContent = text
|
||||
Object.assign(btn.style, {
|
||||
...style,
|
||||
border: 'none',
|
||||
color: '#fff',
|
||||
background: 'none',
|
||||
height: '20px',
|
||||
cursor: 'pointer',
|
||||
position: 'absolute',
|
||||
top: '5px',
|
||||
fontSize: '12px',
|
||||
lineHeight: '12px',
|
||||
})
|
||||
imageListContainer.append(btn)
|
||||
return btn
|
||||
}
|
||||
const showBtn = document.createElement('button')
|
||||
const closeBtn = createImgListBtn('❌', {
|
||||
width: '20px',
|
||||
textIndent: '-4px',
|
||||
right: '5px',
|
||||
})
|
||||
const loadButton = createImgListBtn('Load Session History', {
|
||||
right: '90px',
|
||||
})
|
||||
const clearButton = createImgListBtn('Clear', {
|
||||
right: '30px',
|
||||
})
|
||||
|
||||
//- tools popup button
|
||||
showBtn.classList.add('comfy-settings-btn')
|
||||
Object.assign(showBtn.style, {
|
||||
right: '16px',
|
||||
cursor: 'pointer',
|
||||
display: 'none',
|
||||
})
|
||||
//- tools popup button
|
||||
showBtn.classList.add('comfy-settings-btn')
|
||||
Object.assign(showBtn.style, {
|
||||
right: '16px',
|
||||
cursor: 'pointer',
|
||||
display: 'none',
|
||||
})
|
||||
|
||||
//- append to DOM
|
||||
document.body.append(imageListContainer)
|
||||
//- append to DOM
|
||||
document.body.append(imageListContainer)
|
||||
|
||||
showBtn.textContent = '🖼'
|
||||
showBtn.onclick = () => {
|
||||
imageListContainer.style.display = 'block'
|
||||
showBtn.style.display = 'none'
|
||||
}
|
||||
document.querySelector('.comfy-settings-btn').after(showBtn)
|
||||
document.querySelector('.comfy-settings-btn').after(lightboxContainer)
|
||||
showBtn.textContent = '🖼'
|
||||
showBtn.onclick = () => {
|
||||
imageListContainer.style.display = 'block'
|
||||
showBtn.style.display = 'none'
|
||||
}
|
||||
document.querySelector('.comfy-settings-btn').after(showBtn)
|
||||
document.querySelector('.comfy-settings-btn').after(lightboxContainer)
|
||||
|
||||
// for (const { output } of history) {
|
||||
// if (output?.images) {
|
||||
// for (const src of output.images) {
|
||||
// const img = document.createElement("img");
|
||||
// const but = document.createElement("button");
|
||||
// for (const { output } of history) {
|
||||
// if (output?.images) {
|
||||
// for (const src of output.images) {
|
||||
// const img = document.createElement("img");
|
||||
// const but = document.createElement("button");
|
||||
|
||||
//- callbacks
|
||||
closeBtn.onclick = () => {
|
||||
imageListContainer.style.display = 'none'
|
||||
showBtn.style.display = 'unset'
|
||||
}
|
||||
//- callbacks
|
||||
closeBtn.onclick = () => {
|
||||
imageListContainer.style.display = 'none'
|
||||
showBtn.style.display = 'unset'
|
||||
}
|
||||
|
||||
clearButton.onclick = () => {
|
||||
imageListContainer.replaceChildren(closeBtn, clearButton, loadButton)
|
||||
}
|
||||
clearButton.onclick = () => {
|
||||
imageListContainer.replaceChildren(closeBtn, clearButton, loadButton)
|
||||
}
|
||||
|
||||
lightboxNextBtn.onclick = () => {
|
||||
currentImageIndex = (currentImageIndex + 1) % imageUrls.length
|
||||
const imageUrl = imageUrls[currentImageIndex]
|
||||
lightboxImage.src = imageUrl
|
||||
}
|
||||
lightboxNextBtn.onclick = () => {
|
||||
currentImageIndex = (currentImageIndex + 1) % imageUrls.length
|
||||
const imageUrl = imageUrls[currentImageIndex]
|
||||
lightboxImage.src = imageUrl
|
||||
}
|
||||
|
||||
// Modify the lightboxPrevBtn onclick callback
|
||||
lightboxPrevBtn.onclick = () => {
|
||||
currentImageIndex =
|
||||
(currentImageIndex - 1 + imageUrls.length) % imageUrls.length
|
||||
const imageUrl = imageUrls[currentImageIndex]
|
||||
lightboxImage.src = imageUrl
|
||||
}
|
||||
// Modify the lightboxPrevBtn onclick callback
|
||||
lightboxPrevBtn.onclick = () => {
|
||||
currentImageIndex =
|
||||
(currentImageIndex - 1 + imageUrls.length) % imageUrls.length
|
||||
const imageUrl = imageUrls[currentImageIndex]
|
||||
lightboxImage.src = imageUrl
|
||||
}
|
||||
|
||||
lightboxCloseBtn.onclick = () => {
|
||||
lightboxContainer.style.display = 'none'
|
||||
}
|
||||
lightboxImage.onclick = lightboxNextBtn.onclick
|
||||
/**
|
||||
* This is the function that creates the image buttons for the image list
|
||||
* They are wrapped in a button so that they can be clicked and open
|
||||
* the image in the lightbox.
|
||||
* @param {*} src
|
||||
*/
|
||||
const createImageBtn = (src) => {
|
||||
console.debug(`making image ${src.filename}`)
|
||||
const img = document.createElement('img')
|
||||
const but = document.createElement('button')
|
||||
lightboxCloseBtn.onclick = () => {
|
||||
lightboxContainer.style.display = 'none'
|
||||
}
|
||||
lightboxImage.onclick = lightboxNextBtn.onclick
|
||||
/**
|
||||
* This is the function that creates the image buttons for the image list
|
||||
* They are wrapped in a button so that they can be clicked and open
|
||||
* the image in the lightbox.
|
||||
* @param {*} src
|
||||
*/
|
||||
const createImageBtn = (src) => {
|
||||
console.debug(`making image ${src.filename}`)
|
||||
const img = document.createElement('img')
|
||||
const but = document.createElement('button')
|
||||
|
||||
Object.assign(but.style, {
|
||||
height: '120px',
|
||||
width: '120px',
|
||||
border: 'none',
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
})
|
||||
Object.assign(img.style, {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
objectFit: 'cover',
|
||||
})
|
||||
Object.assign(but.style, {
|
||||
height: '120px',
|
||||
width: '120px',
|
||||
border: 'none',
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
})
|
||||
Object.assign(img.style, {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
objectFit: 'cover',
|
||||
})
|
||||
|
||||
img.src = `/view?filename=${encodeURIComponent(src.filename)}&type=${
|
||||
src.type
|
||||
}&subfolder=${encodeURIComponent(src.subfolder)}`
|
||||
img.src = `/view?filename=${encodeURIComponent(src.filename)}&type=${
|
||||
src.type
|
||||
}&subfolder=${encodeURIComponent(src.subfolder)}`
|
||||
|
||||
imageUrls.push(img.src)
|
||||
imageUrls.push(img.src)
|
||||
|
||||
console.debug(img.src)
|
||||
console.debug(img.src)
|
||||
|
||||
img.onload = () => {
|
||||
but.style.width = `${120 * (img.naturalWidth / img.naturalHeight)}px`
|
||||
}
|
||||
img.onload = () => {
|
||||
but.style.width = `${120 * (img.naturalWidth / img.naturalHeight)}px`
|
||||
}
|
||||
|
||||
but.onclick = () => {
|
||||
lightboxContainer.style.display = 'flex'
|
||||
// add the same image to the lightbox
|
||||
lightboxImage.src = img.src
|
||||
// lighboxContainer.replaceChildren(lightboxButtons, img);
|
||||
}
|
||||
but.onclick = () => {
|
||||
lightboxContainer.style.display = 'flex'
|
||||
// add the same image to the lightbox
|
||||
lightboxImage.src = img.src
|
||||
// lighboxContainer.replaceChildren(lightboxButtons, img);
|
||||
}
|
||||
|
||||
// add right click menu
|
||||
but.addEventListener('contextmenu', (e) => {
|
||||
e.preventDefault()
|
||||
// add right click menu
|
||||
but.addEventListener('contextmenu', (e) => {
|
||||
e.preventDefault()
|
||||
|
||||
if (image_menu) {
|
||||
image_menu.remove()
|
||||
}
|
||||
if (image_menu) {
|
||||
image_menu.remove()
|
||||
}
|
||||
|
||||
image_menu = document.createElement('div')
|
||||
Object.assign(image_menu.style, {
|
||||
position: 'absolute',
|
||||
top: `${e.clientY}px`,
|
||||
left: `${e.clientX}px`,
|
||||
background: '#333',
|
||||
color: '#fff',
|
||||
padding: '5px',
|
||||
borderRadius: '5px',
|
||||
zIndex: 999,
|
||||
})
|
||||
const load_img = document.createElement('button')
|
||||
load_img.textContent = 'Load'
|
||||
load_img.onclick = () => {
|
||||
app.handleFile(img.src)
|
||||
}
|
||||
image_menu = document.createElement('div')
|
||||
Object.assign(image_menu.style, {
|
||||
position: 'absolute',
|
||||
top: `${e.clientY}px`,
|
||||
left: `${e.clientX}px`,
|
||||
background: '#333',
|
||||
color: '#fff',
|
||||
padding: '5px',
|
||||
borderRadius: '5px',
|
||||
zIndex: 999,
|
||||
})
|
||||
const load_img = document.createElement('button')
|
||||
load_img.textContent = 'Load'
|
||||
load_img.onclick = () => {
|
||||
app.handleFile(img.src)
|
||||
}
|
||||
|
||||
image_menu.appendChild(load_img)
|
||||
document.body.appendChild(image_menu)
|
||||
})
|
||||
image_menu.appendChild(load_img)
|
||||
document.body.appendChild(image_menu)
|
||||
})
|
||||
|
||||
but.append(img)
|
||||
imageListContainer.prepend(but)
|
||||
}
|
||||
but.append(img)
|
||||
imageListContainer.prepend(but)
|
||||
}
|
||||
|
||||
loadButton.onclick = async () => {
|
||||
const all_history = await api.getHistory()
|
||||
for (const history of all_history.History) {
|
||||
if (history.outputs) {
|
||||
for (const key of Object.keys(history.outputs)) {
|
||||
console.debug(key)
|
||||
if (history.outputs[key].images) {
|
||||
for (const im of history.outputs[key].images) {
|
||||
console.debug(im)
|
||||
createImageBtn(im)
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (const src of outputs.outputs.images) {
|
||||
// console.debug(src)
|
||||
// makeImage(`${src.subfolder}/${src.filename}`)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
loadButton.onclick = async () => {
|
||||
const all_history = await api.getHistory()
|
||||
for (const history of all_history.History) {
|
||||
if (history.outputs) {
|
||||
for (const key of Object.keys(history.outputs)) {
|
||||
console.debug(key)
|
||||
if (history.outputs[key].images) {
|
||||
for (const im of history.outputs[key].images) {
|
||||
console.debug(im)
|
||||
createImageBtn(im)
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (const src of outputs.outputs.images) {
|
||||
// console.debug(src)
|
||||
// makeImage(`${src.subfolder}/${src.filename}`)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////-------
|
||||
///////-------
|
||||
|
||||
// const all_history = await api.getHistory()
|
||||
// for (const history of all_history.History) {
|
||||
// if (history.outputs) {
|
||||
// for (const key of Object.keys(history.outputs)) {
|
||||
// for (const im of history.outputs[key].images) {
|
||||
// makeImage(im)
|
||||
// }
|
||||
// }
|
||||
// // for (const src of outputs.outputs.images) {
|
||||
// // console.debug(src)
|
||||
// // makeImage(`${src.subfolder}/${src.filename}`)
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
// const all_history = await api.getHistory()
|
||||
// for (const history of all_history.History) {
|
||||
// if (history.outputs) {
|
||||
// for (const key of Object.keys(history.outputs)) {
|
||||
// for (const im of history.outputs[key].images) {
|
||||
// makeImage(im)
|
||||
// }
|
||||
// }
|
||||
// // for (const src of outputs.outputs.images) {
|
||||
// // console.debug(src)
|
||||
// // makeImage(`${src.subfolder}/${src.filename}`)
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
|
||||
//- Hook into the API
|
||||
api.addEventListener('executed', ({ detail }) => {
|
||||
if (detail?.output?.images) {
|
||||
for (const src of detail.output.images) {
|
||||
console.debug(`Adding ${src} to image feed`)
|
||||
createImageBtn(src)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//- Hook into the API
|
||||
api.addEventListener('executed', ({ detail }) => {
|
||||
if (detail?.output?.images) {
|
||||
for (const src of detail.output.images) {
|
||||
console.debug(`Adding ${src} to image feed`)
|
||||
createImageBtn(src)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
import { app } from '../../scripts/app.js'
|
||||
import { api } from '../../scripts/api.js'
|
||||
|
||||
// import * as shared from './comfy_shared.js'
|
||||
|
||||
import {
|
||||
// defineCSSClass,
|
||||
ensureMTBStyles,
|
||||
makeElement,
|
||||
makeSelect,
|
||||
makeSlider,
|
||||
renderSidebar,
|
||||
} from './mtb_ui.js'
|
||||
|
||||
const offset = 0
|
||||
let currentWidth = 200
|
||||
let currentMode = 'input'
|
||||
let currentSort = 'None'
|
||||
|
||||
const IMAGE_NODES = ['LoadImage']
|
||||
|
||||
const updateImage = (node, image) => {
|
||||
if (IMAGE_NODES.includes(node.type)) {
|
||||
const w = node.widgets?.find((w) => w.name === 'image')
|
||||
if (w) {
|
||||
w.value = image
|
||||
w.callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getImgsFromUrls = (urls, target) => {
|
||||
const imgs = []
|
||||
if (urls === undefined) {
|
||||
return imgs
|
||||
}
|
||||
|
||||
for (const [key, url] of Object.entries(urls)) {
|
||||
const a = makeElement('img')
|
||||
a.src = url
|
||||
a.width = currentWidth
|
||||
if (currentMode === 'input') {
|
||||
a.onclick = (_e) => {
|
||||
const selected = app.canvas.selected_nodes
|
||||
if (selected && Object.keys(selected).length === 0) {
|
||||
app.extensionManager.toast.add({
|
||||
severity: 'warn',
|
||||
summary: 'No LoadImage node selected!',
|
||||
detail:
|
||||
'For now the only action when clicking images in the sidebar is to set the image on all selected LoadImage nodes.',
|
||||
life: 5000,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
for (const [_id, node] of Object.entries(app.canvas.selected_nodes)) {
|
||||
updateImage(node, key)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
a.onclick = (_e) =>
|
||||
// window.MTB?.notify?.("Output import isn't supported yet...", 5000)
|
||||
app.extensionManager.toast.add({
|
||||
severity: 'warn',
|
||||
summary: 'Outputs not supported',
|
||||
detail:
|
||||
'For now only inputs can be clicked to load the image on the active LoadImage node.',
|
||||
life: 5000,
|
||||
})
|
||||
}
|
||||
imgs.push(a)
|
||||
}
|
||||
if (target !== undefined) {
|
||||
target.append(...imgs)
|
||||
}
|
||||
return imgs
|
||||
}
|
||||
|
||||
const getUrls = async () => {
|
||||
const count = await api.getSetting('mtb.io-sidebar.count')
|
||||
console.log('Sidebar count', count)
|
||||
const inputs = await api.fetchApi('/mtb/actions', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
name: 'getUserImages',
|
||||
// mode, count, offset
|
||||
args: [currentMode, count, offset, currentSort],
|
||||
}),
|
||||
})
|
||||
const output = await inputs.json()
|
||||
return output?.result || {}
|
||||
}
|
||||
|
||||
//NOTE: do not load if using the old ui
|
||||
if (window?.__COMFYUI_FRONTEND_VERSION__) {
|
||||
// NOTE: removed this for now since I'm not actually exposing anything a client
|
||||
// cannot already access from "/view"...
|
||||
// let exposed = false
|
||||
|
||||
const sidebar_extension = {
|
||||
name: 'mtb.io-sidebar',
|
||||
// init: async () => {
|
||||
// try {
|
||||
// const res = await api.fetchApi('/mtb/server-info')
|
||||
// const msg = await res.json()
|
||||
// exposed = msg.exposed
|
||||
// } catch (e) {
|
||||
// console.error('Error:', e)
|
||||
// }
|
||||
// },
|
||||
init: () => {
|
||||
let handle
|
||||
const version = window?.__COMFYUI_FRONTEND_VERSION__
|
||||
console.log(`%c ${version}`, 'background: orange; color: white;')
|
||||
|
||||
ensureMTBStyles()
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: 'mtb.io-sidebar.count',
|
||||
category: ['mtb', 'Input & Output Sidebar', 'count'],
|
||||
|
||||
name: 'Number of images to fetch',
|
||||
type: 'number',
|
||||
defaultValue: 1000,
|
||||
|
||||
tooltip:
|
||||
"This setting affects the input/output sidebar to determine how many images to fetch per pagination (pagination is not yet supported so for now it's the static total)",
|
||||
attrs: {
|
||||
style: {
|
||||
// fontFamily: 'monospace',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: 'mtb.io-sidebar.img-size',
|
||||
category: ['mtb', 'Input & Output Sidebar', 'img-size'],
|
||||
|
||||
name: 'Resolution of the images',
|
||||
type: 'number',
|
||||
defaultValue: 512,
|
||||
|
||||
tooltip: "It's recommended to keep it at 512px",
|
||||
attrs: {
|
||||
style: {
|
||||
// fontFamily: 'monospace',
|
||||
},
|
||||
},
|
||||
})
|
||||
app.ui.settings.addSetting({
|
||||
id: 'mtb.io-sidebar.sort',
|
||||
category: ['mtb', 'Input & Output Sidebar', 'sort'],
|
||||
name: 'Default sort mode',
|
||||
type: 'combo',
|
||||
|
||||
onChange: (v) => {
|
||||
// alert(`Sort is now ${v}`)
|
||||
currentSort = v
|
||||
},
|
||||
|
||||
defaultValue: 'Modified',
|
||||
// tooltip: "It's recommended to keep it at 512px",
|
||||
options: [
|
||||
'None',
|
||||
'Modified',
|
||||
'Modified-Reverse',
|
||||
'Name',
|
||||
'Name-Reverse',
|
||||
],
|
||||
})
|
||||
|
||||
app.extensionManager.registerSidebarTab({
|
||||
id: 'mtb-inputs-outputs',
|
||||
icon: 'pi pi-images',
|
||||
title: 'Input & Outputs',
|
||||
tooltip: 'MTB: Browse inputs and outputs directories.',
|
||||
type: 'custom',
|
||||
|
||||
// this is run everytime the tab's diplay is toggled on.
|
||||
render: async (el) => {
|
||||
if (handle) {
|
||||
handle.unregister()
|
||||
handle = undefined
|
||||
}
|
||||
|
||||
if (el.parentNode) {
|
||||
el.parentNode.style.overflowY = 'clip'
|
||||
}
|
||||
|
||||
const urls = await getUrls(currentMode)
|
||||
let imgs = {}
|
||||
|
||||
const cont = makeElement('div.mtb_sidebar')
|
||||
|
||||
const imgGrid = makeElement('div.mtb_img_grid')
|
||||
const selector = makeSelect(['input', 'output'], currentMode)
|
||||
|
||||
selector.addEventListener('change', async (e) => {
|
||||
const newMode = e.target.value
|
||||
const changed = newMode !== currentMode
|
||||
currentMode = newMode
|
||||
if (changed) {
|
||||
imgGrid.innerHTML = ''
|
||||
const urls = await getUrls()
|
||||
if (urls) {
|
||||
imgs = getImgsFromUrls(urls, imgGrid)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const imgTools = makeElement('div.mtb_tools')
|
||||
const orderSelect = makeSelect(
|
||||
['None', 'Modified', 'Modified-Reverse', 'Name', 'Name-Reverse'],
|
||||
currentSort,
|
||||
)
|
||||
|
||||
orderSelect.addEventListener('change', async (e) => {
|
||||
const newSort = e.target.value
|
||||
const changed = newSort !== currentSort
|
||||
currentSort = newSort
|
||||
if (changed) {
|
||||
imgGrid.innerHTML = ''
|
||||
const urls = await getUrls()
|
||||
if (urls) {
|
||||
imgs = getImgsFromUrls(urls, imgGrid)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const sizeSlider = makeSlider(64, 1024, currentWidth, 1)
|
||||
imgTools.appendChild(orderSelect)
|
||||
|
||||
imgTools.appendChild(sizeSlider)
|
||||
|
||||
imgs = getImgsFromUrls(urls, imgGrid)
|
||||
|
||||
sizeSlider.addEventListener('input', (e) => {
|
||||
currentWidth = e.target.value
|
||||
for (const img of imgs) {
|
||||
img.style.width = `${e.target.value}px`
|
||||
}
|
||||
})
|
||||
handle = renderSidebar(el, cont, [selector, imgGrid, imgTools])
|
||||
},
|
||||
destroy: () => {
|
||||
if (handle) {
|
||||
handle.unregister()
|
||||
handle = undefined
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
app.registerExtension(sidebar_extension)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// NOTE: this will be the LT part of mtb API system
|
||||
// I need to properly publish the source and fix a few things before
|
||||
|
||||
// import { app } from '../../scripts/app.js'
|
||||
// // import { api } from '../../scripts/api.js'
|
||||
//
|
||||
// import * as shared from './comfy_shared.js'
|
||||
// import { createOutliner } from './dist/mtb_inspector.js'
|
||||
//
|
||||
// if (window?.__COMFYUI_FRONTEND_VERSION__) {
|
||||
// const version = window?.__COMFYUI_FRONTEND_VERSION__
|
||||
// console.log(`%c ${version}`, 'background: orange; color: white;')
|
||||
//
|
||||
// const panel = app.extensionManager.registerSidebarTab({
|
||||
// id: 'mtb-nodes',
|
||||
// icon: 'pi pi-bolt',
|
||||
// title: 'MTB',
|
||||
// tooltip: 'MTB: API outliner',
|
||||
// type: 'custom',
|
||||
// // this is run everytime the tab's diplay is toggled on.
|
||||
// render: (el) => {
|
||||
// const outliner = createOutliner(el)
|
||||
// const inputs = shared.getAPIInputs()
|
||||
// console.log('INPUTS', inputs)
|
||||
// outliner.$$set({ inputs })
|
||||
// },
|
||||
// })
|
||||
// }
|
||||
+504
@@ -0,0 +1,504 @@
|
||||
/**
|
||||
* Adds a named stylesheet to the document with an optional ability to replace an existing one.
|
||||
*
|
||||
* @param {string} name - The unique name (ID) of the stylesheet.
|
||||
* @param {string} css - The CSS rules as a string.
|
||||
* @param {boolean} [force=false] - Whether to replace the existing stylesheet if it exists.
|
||||
* @returns {void}
|
||||
*/
|
||||
export function addNamedStyleSheet(name, css, force = false) {
|
||||
const existingStyleSheet = document.getElementById(name)
|
||||
|
||||
if (existingStyleSheet && !force) {
|
||||
console.debug(
|
||||
`Stylesheet with name "${name}" already exists. Skipping addition.`,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if (existingStyleSheet && force) {
|
||||
console.debug(`Stylesheet with name "${name}" exists. Replacing...`)
|
||||
existingStyleSheet.remove()
|
||||
}
|
||||
|
||||
const styleElement = document.createElement('style')
|
||||
styleElement.id = name
|
||||
styleElement.type = 'text/css'
|
||||
|
||||
styleElement.appendChild(document.createTextNode(css))
|
||||
document.head.appendChild(styleElement)
|
||||
|
||||
console.debug(`Stylesheet with name "${name}" added.`)
|
||||
}
|
||||
|
||||
export const ensureMTBStyles = () => {
|
||||
const S = {
|
||||
fg: 'var(--fg-color)',
|
||||
bgi: 'var(--comfy-input-bg)',
|
||||
bgm: 'var(--comfy-menu-bg)',
|
||||
border: 'var(--comfy-border)',
|
||||
borderHover: 'var(--comfy-border-hover)',
|
||||
box: 'var(--comfy-box)',
|
||||
accent: 'var(--p-button-text-primary-color)',
|
||||
}
|
||||
const common = `
|
||||
.mtb_sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: ${S.bgm};
|
||||
}
|
||||
.mtb_img_grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
overflow: scroll;
|
||||
gap: 1em;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.mtb_tools {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
`
|
||||
const inputs = `
|
||||
/* SELECT */
|
||||
.mtb_select {
|
||||
appearance: none;
|
||||
display: grid;
|
||||
grid-template-areas: "select";
|
||||
padding: 10px;
|
||||
background-color: ${S.bgi};
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
font-size: 14px;
|
||||
color: ${S.fg};
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@supports (-moz-appearance:none) {
|
||||
.mtb_select{
|
||||
grid-area: select;
|
||||
background: ${S.bgi} url('data:image/gif;base64,R0lGODlhBgAGAKEDAFVVVX9/f9TU1CgmNyH5BAEKAAMALAAAAAAGAAYAAAIODA4hCDKWxlhNvmCnGwUAOw==') right center no-repeat !important;
|
||||
background-position: calc(100% - 5px) center !important;
|
||||
-moz-appearance:none !important;
|
||||
}
|
||||
|
||||
/* styling the dropdown arrow for browsers that support it */
|
||||
.mtb_select:after {
|
||||
content: "";
|
||||
width: 0.8em;
|
||||
height: 0.5em;
|
||||
background-color: ${S.fg};
|
||||
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
|
||||
}
|
||||
|
||||
.mtb_select:focus {
|
||||
outline: none;
|
||||
border-color: #0056b3;
|
||||
}
|
||||
|
||||
.mtb_select > option {
|
||||
padding: 10px;
|
||||
background-color: ${S.bgi};
|
||||
border:none;
|
||||
color: ${S.fg};
|
||||
}
|
||||
|
||||
.mtb_select > option:hover {
|
||||
background-color: red;
|
||||
color: ${S.fg};
|
||||
}
|
||||
|
||||
/* SLIDER */
|
||||
.mtb_slider[type="range"] {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
background: ${S.bgm};
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
opacity: 0.7;
|
||||
transition: opacity .2s;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
/* slider track */
|
||||
.mtb_slider[type="range"]::-webkit-slider-runnable-track,
|
||||
.mtb_slider[type="range"]::-moz-range-track {
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
background: ${S.bgi};
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
/* progress */
|
||||
.mtb_slider[type="range"]::-moz-range-progress {
|
||||
background-color: ${S.accent};
|
||||
height:10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* slider thumb (the handle) */
|
||||
.mtb_slider[type="range"]::-webkit-slider-thumb,
|
||||
.mtb_slider[type="range"]::-moz-range-thumb
|
||||
{
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 50%;
|
||||
background: ${S.fg};
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
filter: drop-shadow(1px 1px 4px black);
|
||||
}
|
||||
|
||||
.mtb_slider[type="range"]:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.mtb_slider[type=range]:-moz-focusring{
|
||||
outline: 1px solid red;
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
||||
.mtb_slider[type="range"]:hover::-webkit-slider-thumb,
|
||||
.mtb_slider[type="range"]:active::-webkit-slider-thumb {
|
||||
background-color: ${S.accent};
|
||||
}
|
||||
`
|
||||
addNamedStyleSheet(
|
||||
'mtb_ui',
|
||||
`
|
||||
${common}
|
||||
${inputs}
|
||||
`,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a DOM element with optional styles, class, and id.
|
||||
*
|
||||
* @param {string} kind - The tag name of the element. Supports class and id syntax (e.g. 'div.class#id').
|
||||
* @param {Object} [style] - CSS styles to apply to the element.
|
||||
* @returns {HTMLElement} - The created DOM element.
|
||||
*/
|
||||
export const makeElement = (kind, style) => {
|
||||
let [real_kind, className] = kind.split('.')
|
||||
let id
|
||||
|
||||
if (className?.includes('#')) {
|
||||
;[className, id] = className.split('#')
|
||||
}
|
||||
|
||||
const el = document.createElement(real_kind)
|
||||
|
||||
if (style) {
|
||||
Object.assign(el.style, style)
|
||||
}
|
||||
|
||||
if (className) {
|
||||
el.classList.add(...className.split(' ')) // Support multiple classes
|
||||
}
|
||||
|
||||
if (id) {
|
||||
el.id = id
|
||||
}
|
||||
|
||||
return el
|
||||
}
|
||||
/**
|
||||
* Clears all child elements of the given parent element.
|
||||
*
|
||||
* @param {HTMLElement} el - The parent element whose children should be removed.
|
||||
*/
|
||||
export const clearElement = (el) => {
|
||||
while (el.firstChild) {
|
||||
el.removeChild(el.firstChild)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates a labeled element (input, select, etc.).
|
||||
*
|
||||
* @param {HTMLElement} el - The element to label.
|
||||
* @param {string} labelText - The label text.
|
||||
* @returns {HTMLDivElement} - A div containing the label and the element.
|
||||
*/
|
||||
export const makeLabeledElement = (el, labelText) => {
|
||||
const wrapper = makeElement('div.mtb_labeled_element', {
|
||||
marginBottom: '1em',
|
||||
})
|
||||
const label = makeElement('label', {
|
||||
display: 'block',
|
||||
marginBottom: '0.5em',
|
||||
})
|
||||
label.textContent = labelText
|
||||
wrapper.appendChild(label)
|
||||
wrapper.appendChild(el)
|
||||
return wrapper
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a camelCase CSS property to kebab-case.
|
||||
*
|
||||
* @param {string} prop - The camelCase CSS property.
|
||||
* @returns {string} - The kebab-case CSS property.
|
||||
*/
|
||||
const camelToKebab = (prop) =>
|
||||
prop.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`)
|
||||
|
||||
/**
|
||||
* Parses the style string into an object of CSS property-value pairs.
|
||||
*
|
||||
* @param {string} styleString - The CSS rule text (e.g., "color: red; background-color: blue;").
|
||||
* @returns {Object} - An object with camelCase CSS properties.
|
||||
*/
|
||||
const parseStyleString = (styleString) => {
|
||||
const styleObj = {}
|
||||
for (const rule of styleString.split(';')) {
|
||||
const [property, value] = rule.split(':').map((item) => item.trim())
|
||||
if (property && value) {
|
||||
const camelProp = property.replace(/-([a-z])/g, (g) => g[1].toUpperCase())
|
||||
styleObj[camelProp] = value
|
||||
}
|
||||
}
|
||||
return styleObj
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a new CSS class with the provided styles, or skips if the class already exists.
|
||||
*
|
||||
* @param {string} className - The name of the CSS class to define.
|
||||
* @param {Object} classStyles - An object containing camelCase CSS property-value pairs.
|
||||
*/
|
||||
export function defineCSSClass(className, classStyles) {
|
||||
const styleSheets = document.styleSheets
|
||||
let classExists = false
|
||||
let existingStyleString = ''
|
||||
const classExistsInStyleSheet = (styleSheet) => {
|
||||
const rules = styleSheet.rules || styleSheet.cssRules
|
||||
for (const rule of rules) {
|
||||
if (rule.selectorText === `.${className}`) {
|
||||
classExists = true
|
||||
existingStyleString = rule.style.cssText // Capture existing styles
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
for (const styleSheet of styleSheets) {
|
||||
if (classExistsInStyleSheet(styleSheet)) {
|
||||
console.debug(`Class ${className} already exists, merging styles...`)
|
||||
break
|
||||
}
|
||||
}
|
||||
const existingStyles = classExists
|
||||
? parseStyleString(existingStyleString)
|
||||
: {}
|
||||
const mergedStyles = { ...existingStyles, ...classStyles }
|
||||
|
||||
const stylesString = Object.entries(mergedStyles)
|
||||
.map(([key, value]) => `${camelToKebab(key)}: ${value};`)
|
||||
.join(' ')
|
||||
|
||||
if (!classExists) {
|
||||
console.debug(`Defining new class ${className}...`)
|
||||
if (styleSheets[0].insertRule) {
|
||||
styleSheets[0].insertRule(`.${className} { ${stylesString} }`, 0)
|
||||
} else if (styleSheets[0].addRule) {
|
||||
styleSheets[0].addRule(`.${className}`, stylesString, 0)
|
||||
}
|
||||
} else {
|
||||
console.debug(`Updating existing class ${className} with merged styles...`)
|
||||
for (const styleSheet of styleSheets) {
|
||||
const rules = styleSheet.rules || styleSheet.cssRules
|
||||
for (const rule of rules) {
|
||||
if (rule.selectorText === `.${className}`) {
|
||||
rule.style.cssText = stylesString // Update the existing rule
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.debug(
|
||||
`Class ${className} has been defined/updated with styles:`,
|
||||
mergedStyles,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a sidebar and ensures it resizes correctly when the window is resized.
|
||||
*
|
||||
* @param {HTMLElement} el - The element where the sidebar is rendered.
|
||||
* @param {HTMLElement} cont - The content container of the sidebar.
|
||||
* @param {HTMLElement[]} elems - Array of elements to append to the sidebar.
|
||||
* @returns {Object} - A handle with a method to unregister the resize event.
|
||||
*/
|
||||
export const renderSidebar = (el, cont, elems) => {
|
||||
el.appendChild(cont)
|
||||
|
||||
if (!el.parentNode) {
|
||||
return
|
||||
}
|
||||
el.parentNode.style.overflowY = 'clip'
|
||||
cont.style.height = `${el.parentNode.offsetHeight}px`
|
||||
|
||||
const resizeHandler = () => {
|
||||
cont.style.height = `${el.parentNode.offsetHeight}px`
|
||||
}
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
|
||||
for (const elem of elems) {
|
||||
cont.appendChild(elem)
|
||||
}
|
||||
|
||||
return {
|
||||
unregister: () => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a <select> dropdown with given options.
|
||||
*
|
||||
* @param {string[]} options - The options for the select element.
|
||||
* @param {string} [current] - The currently selected option (optional).
|
||||
* @returns {HTMLSelectElement} - The created <select> element.
|
||||
*/
|
||||
export const makeSelect = (options, current = undefined) => {
|
||||
const selector = makeElement('select.mtb_select', {
|
||||
width: 'auto',
|
||||
margin: '1em',
|
||||
})
|
||||
|
||||
for (const option of options) {
|
||||
const opt = makeElement('option')
|
||||
opt.value = option
|
||||
opt.innerHTML = option
|
||||
selector.appendChild(opt)
|
||||
}
|
||||
|
||||
if (current !== undefined) {
|
||||
if (options.includes(current)) {
|
||||
selector.value = current
|
||||
} else {
|
||||
console.error(
|
||||
`You tried to select an option that doesn't exist (${current}). Options: ${options}`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return selector
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an <input type="range"> slider element with given parameters.
|
||||
*
|
||||
* @param {number} min - Minimum value of the slider.
|
||||
* @param {number} max - Maximum value of the slider.
|
||||
* @param {number} [value] - Initial value of the slider.
|
||||
* @param {number} [step] - Step value for the slider.
|
||||
* @returns {HTMLInputElement} - The created slider element.
|
||||
*/
|
||||
export const makeSlider = (min, max, value = undefined, step = undefined) => {
|
||||
const slider = makeElement('input.mtb_slider', {
|
||||
width: '100%',
|
||||
})
|
||||
|
||||
slider.type = 'range'
|
||||
slider.min = min || 0
|
||||
slider.max = max || 100
|
||||
slider.value = value || slider.min
|
||||
slider.step = step || 1
|
||||
|
||||
return slider
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a button element.
|
||||
*
|
||||
* @param {string} label - The label for the button.
|
||||
* @param {Object} [style] - Optional styles to apply to the button.
|
||||
* @param {Function} [onClick] - Optional click handler.
|
||||
* @returns {HTMLButtonElement} - The created button element.
|
||||
*/
|
||||
export const makeButton = (label, style = {}, onClick = undefined) => {
|
||||
const button = makeElement('button.mtb_button', style)
|
||||
button.textContent = label
|
||||
|
||||
if (onClick) {
|
||||
button.addEventListener('click', onClick)
|
||||
}
|
||||
|
||||
return button
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a resizable splitter between two elements.
|
||||
*
|
||||
* @param {HTMLElement} el1 - The first element.
|
||||
* @param {HTMLElement} el2 - The second element.
|
||||
* @param {'vertical' | 'horizontal'} direction - Splitter direction (vertical or horizontal).
|
||||
* @param {'absolute' | 'normal'} mode - Splitter mode: 'absolute' for free resizing, 'normal' for layout-based resizing.
|
||||
* @returns {HTMLDivElement} - The container with resizable splitter.
|
||||
*/
|
||||
export const makeSplitter = (
|
||||
el1,
|
||||
el2,
|
||||
direction = 'vertical',
|
||||
mode = 'normal',
|
||||
) => {
|
||||
const container = makeElement('div.mtb_splitter_container', {
|
||||
display: mode === 'absolute' ? 'block' : 'flex',
|
||||
flexDirection: direction === 'vertical' ? 'row' : 'column',
|
||||
position: mode === 'absolute' ? 'relative' : 'static',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
})
|
||||
|
||||
const handle = makeElement('div.mtb_splitter_handle', {
|
||||
backgroundColor: '#ccc',
|
||||
cursor: direction === 'vertical' ? 'col-resize' : 'row-resize',
|
||||
width: direction === 'vertical' ? '5px' : '100%',
|
||||
height: direction === 'horizontal' ? '5px' : '100%',
|
||||
})
|
||||
|
||||
let isResizing = false
|
||||
|
||||
handle.addEventListener('mousedown', () => {
|
||||
isResizing = true
|
||||
})
|
||||
|
||||
window.addEventListener('mouseup', () => {
|
||||
isResizing = false
|
||||
})
|
||||
|
||||
window.addEventListener('mousemove', (e) => {
|
||||
if (!isResizing) return
|
||||
if (direction === 'vertical') {
|
||||
const newWidth = e.clientX - container.offsetLeft
|
||||
el1.style.width = `${newWidth}px`
|
||||
el2.style.width = `${container.offsetWidth - newWidth}px`
|
||||
} else {
|
||||
const newHeight = e.clientY - container.offsetTop
|
||||
el1.style.height = `${newHeight}px`
|
||||
el2.style.height = `${container.offsetHeight - newHeight}px`
|
||||
}
|
||||
})
|
||||
|
||||
container.appendChild(el1)
|
||||
container.appendChild(handle)
|
||||
container.appendChild(el2)
|
||||
|
||||
return container
|
||||
}
|
||||
+1155
-1096
File diff suppressed because it is too large
Load Diff
+1
-1
Submodule wiki updated: 4db733ae92...a402de4af9
Reference in New Issue
Block a user