Archived
fixed resources, updated basic sdxl workflow with more params
This commit is contained in:
1 parent
5e69848ff7
commit
67d2904d0a
4 files changed
+27
-10
No files matched your search
@@ -5,6 +5,13 @@ Keep all reusable parameter types here.
|
||||
from pydantic import BaseModel
|
||||
from typing import List, Optional
|
||||
|
||||
class LoopbackParameters(BaseModel):
|
||||
iterations: int = 1
|
||||
upscale: float = 1.0
|
||||
denoise: float = 0.5
|
||||
steps: int = 10
|
||||
cfg: float = 7.0
|
||||
|
||||
class LoraParameters(BaseModel):
|
||||
strength_model: float = 1.0
|
||||
strength_clip: float = 1.0
|
||||
|
||||
+1
-1
@@ -207,7 +207,7 @@ def get_all_models() -> Dict[str, List[Dict]]:
|
||||
|
||||
for model_type in model_types:
|
||||
try:
|
||||
models = get_models_by_type(model_type, skip_indexing=skip_indexing)
|
||||
models = get_models_by_type(model_type)
|
||||
if models: # Only include if models exist
|
||||
resources[model_type] = models
|
||||
except Exception as e:
|
||||
|
||||
+4
-4
@@ -30,28 +30,28 @@ WORKFLOW_FILES: Dict[str, dict] = {
|
||||
},
|
||||
# Add more workflows here as you create them
|
||||
"basic_sdxl": {
|
||||
"file": "basic_sdxl",
|
||||
"script": "basic_sdxl",
|
||||
"name": "Basic SDXL Text to Image",
|
||||
"description": "Workflow with SDXL presets for quick iteration.",
|
||||
"model_types": ["SDXL"],
|
||||
"category": "Image Generation"
|
||||
},
|
||||
"basic_sd15": {
|
||||
"file": "basic_sd15",
|
||||
"script": "basic_sd15",
|
||||
"name": "Basic SD15 Text to Image",
|
||||
"description": "Workflow with SD15 presets for quick iteration.",
|
||||
"model_types": ["SD15"],
|
||||
"category": "Image Generation"
|
||||
},
|
||||
"basic_pony": {
|
||||
"file": "basic_pony",
|
||||
"script": "basic_pony",
|
||||
"name": "Basic Pony Text to Image",
|
||||
"description": "Workflow with Pony presets for quick iteration.",
|
||||
"model_types": ["Pony"],
|
||||
"category": "Image Generation"
|
||||
},
|
||||
"basic_illustrious": {
|
||||
"file": "basic_illustrious",
|
||||
"script": "basic_illustrious",
|
||||
"name": "Basic Illustrious Text to Image",
|
||||
"description": "Workflow with Illustrious presets for quick iteration.",
|
||||
"model_types": ["Illustrious"],
|
||||
|
||||
+15
-5
@@ -9,7 +9,7 @@ import os
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
|
||||
from base import BaseWorkflow
|
||||
from parameters import Lora
|
||||
from parameters import Lora, LoopbackParameters
|
||||
|
||||
# Workflow-specific parameters
|
||||
class WorkflowParams(BaseModel):
|
||||
@@ -19,8 +19,13 @@ class WorkflowParams(BaseModel):
|
||||
loras: List[Lora] = []
|
||||
steps: int = 20
|
||||
seed: int = None
|
||||
cfg: float = 8.0
|
||||
width: int = 512
|
||||
height: int = 512
|
||||
sampler: str = 'euler'
|
||||
scheduler: str = 'normal'
|
||||
loopback: bool = False
|
||||
loopbackParameters: LoopbackParameters = LoopbackParameters()
|
||||
|
||||
# Workflow definition
|
||||
class TestWorkflow(BaseWorkflow):
|
||||
@@ -34,9 +39,14 @@ class TestWorkflow(BaseWorkflow):
|
||||
conditioning = CLIPTextEncode(params.prompt, clip)
|
||||
conditioning2 = CLIPTextEncode(params.negativePrompt, clip)
|
||||
latent = EmptyLatentImage(params.width, params.height, 1)
|
||||
seed = params.seed
|
||||
steps = params.steps
|
||||
latent = KSampler(model, seed, steps, 8, 'euler', 'normal', conditioning, conditioning2, latent, 1)
|
||||
|
||||
latent = KSampler(model, params.seed, params.steps, params.cfg, params.sampler, params.scheduler, conditioning, conditioning2, latent, 1)
|
||||
|
||||
if params.loopback:
|
||||
for _ in range(params.loopbackParameters.iterations):
|
||||
latent = LatentUpscaleBy(latent, 'nearest-exact', params.loopbackParameters.upscale)
|
||||
latent = KSampler(model, params.seed + 1, params.loopbackParameters.steps, params.loopbackParameters.cfg, params.sampler, params.scheduler, conditioning, conditioning2, latent, params.loopbackParameters.denoise)
|
||||
|
||||
image = VAEDecode(latent, vae)
|
||||
preview = PreviewImage(image)
|
||||
|
||||
@@ -49,7 +59,7 @@ class TestWorkflow(BaseWorkflow):
|
||||
# Module-level entry point
|
||||
def run_workflow(**kwargs):
|
||||
"""Entry point for the workflow."""
|
||||
required = ['prompt', 'checkpoints', 'seed', 'steps', 'negativePrompt', 'width', 'height']
|
||||
required = ['prompt', 'checkpoints', 'seed', 'steps', 'negativePrompt', 'width', 'height', 'cfg']
|
||||
missing = [f for f in required if f not in kwargs]
|
||||
if missing:
|
||||
raise ValueError(f"Missing required fields: {', '.join(missing)}")
|
||||
|
||||
Reference in new issue
Block a user