change project structure

This commit is contained in:
mozman
2023-12-17 10:46:59 +01:00
parent 7ee0913ac1
commit 0e4640a916
11 changed files with 24 additions and 51 deletions
+4 -1
View File
@@ -1 +1,4 @@
__pycache__/
__pycache__/
.mypy_cache/
.pytest_cache/
.vscode/
-5
View File
@@ -1,5 +0,0 @@
{
"cSpell.words": [
"twri"
]
}
+7 -2
View File
@@ -50,6 +50,7 @@ def load_style_templates(style_path: pathlib.Path) -> dict[str, Template]:
negative_prompt=record.get("negative_prompt", ""),
)
templates[template.name] = template
templates[BYPASS] = BYPASS_TEMPLATE
return templates
@@ -63,7 +64,10 @@ class ApplyStyle:
@classmethod
def INPUT_TYPES(self):
style_names = sorted(self.TEMPLATES.keys())
style_names.remove(BYPASS)
try:
style_names.remove(BYPASS)
except ValueError:
pass
style_names.insert(0, BYPASS)
return {
@@ -127,13 +131,14 @@ NODE_DEFINITIONS = [
("clipdrop_styles.json", "Apply ClipDrop Style"),
("fooocus.json", "Apply Fooocus Style"),
("art_styles_expansion.json", "Apply Art Style Expansion"),
("technical_documentation.json", "Apply Technical Documentation Style"),
]
def _setup_classes():
cwd = pathlib.Path(__file__).parent
for file_name, display_name in NODE_DEFINITIONS:
templates = load_style_templates(cwd / file_name)
templates = load_style_templates(cwd / "styles" / file_name)
class_name = display_name.replace(" ", "")
# create classes dynamically:
@@ -1,9 +1,4 @@
[
{
"name": "bypass",
"prompt": "{prompt}",
"negative_prompt": ""
},
{
"name": "Abstract Expressionism",
"prompt": "Abstract Expressionism {prompt} , High contrast, minimalistic, colorful, stark, dramatic, expressionism",
@@ -45,8 +40,8 @@
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast"
},
{
"name": "Avant-garde",
"prompt": "Avant-garde {prompt} , unusual, experimental, avant-garde art",
"name": "Avantgarde",
"prompt": "Avantgarde {prompt} , unusual, experimental, avantgarde art",
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast"
},
{
@@ -231,7 +226,7 @@
},
{
"name": "Knolling Photography",
"prompt": "Knolling Photography {prompt} , flat lay photography, object arrangment, knolling photography",
"prompt": "Knolling Photography {prompt} , flat lay photography, object arrangement, knolling photography",
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast"
},
{
@@ -261,7 +256,7 @@
},
{
"name": "Marker Drawing",
"prompt": "Marker Drawing {prompt} , bold marker lines, visibile paper texture, marker drawing",
"prompt": "Marker Drawing {prompt} , bold marker lines, visible paper texture, marker drawing",
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, photograph, realistic"
},
{
@@ -276,7 +271,7 @@
},
{
"name": "Neo-Baroque",
"prompt": "Neo-Baroque {prompt} , ornate and elaborate, dynaimc, Neo-Baroque",
"prompt": "Neo-Baroque {prompt} , ornate and elaborate, dynamic, Neo-Baroque",
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast"
},
{
@@ -1,9 +1,4 @@
[
{
"name": "bypass",
"prompt": "{prompt}",
"negative_prompt": ""
},
{
"name": "Anime",
"prompt": "anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed",
-5
View File
@@ -1,9 +1,4 @@
[
{
"name": "bypass",
"prompt": "{prompt}",
"negative_prompt": ""
},
{
"name": "Fooocus Enhance",
"negative_prompt": "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)"
@@ -1,9 +1,4 @@
[
{
"name": "bypass",
"prompt": "{prompt}",
"negative_prompt": ""
},
{
"name": "mre-cinematic-dynamic",
"prompt": "epic cinematic shot of dynamic {prompt} in motion. main subject of high budget action movie. raw photo, motion blur. best quality, high resolution",
@@ -1,9 +1,4 @@
[
{
"name": "bypass",
"prompt": "{prompt}",
"negative_prompt": ""
},
{
"name": "sai-3d-model",
"prompt": "professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting",
@@ -1,9 +1,4 @@
[
{
"name": "bypass",
"prompt": "{prompt}",
"negative_prompt": ""
},
{
"name": "ads-advertising",
"prompt": "advertising poster style {prompt} . Professional, modern, product-focused, commercial, eye-catching, highly detailed",
@@ -1,9 +1,4 @@
[
{
"name": "base",
"prompt": "{prompt}",
"negative_prompt": ""
},
{
"name": "Architecture Blueprint",
"prompt": "(floor plan: 1.1) architectural sketch style {prompt} . blueprint, oblique, draft, grayscale, flat, scale bars, monochromatic, annotation, hatching",
@@ -27,7 +22,7 @@
{
"name": "Landscape Plan",
"prompt": "sketch style landscape plan, (site analysis:1.2), {prompt} (plan view:1.2), draft, hand-drawn, flat, hatching",
"negative_prompt": "pencil, hand, messy, 3D model, photo, realistic, brush, isometric, perpective, text"
"negative_prompt": "pencil, hand, messy, 3D model, photo, realistic, brush, isometric, perspective, text"
},
{
"name": "Mechanical Sketch",
+7 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) , Manfred Moitzi
# Copyright (c) 2023, Manfred Moitzi
# License: MIT License
import pytest
import re
@@ -23,7 +23,12 @@ def test_valid_class_names():
def test_classes_have_templates():
for cls in NODE_CLASS_MAPPINGS.values():
assert len(cls.TEMPLATES) > 1
assert len(cls.TEMPLATES) > 1, "no styles loaded - correct filename?"
def test_templates_have_bypass_style():
"""The style "bypass" will be added automatically to every style file."""
for cls in NODE_CLASS_MAPPINGS.values():
assert "bypass" in cls.TEMPLATES, "required 'bypass' style not found"
if __name__ == "__main__":