Compare commits

...
8 Commits
3 changed files with 39 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
name: Publish to Comfy registry
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "pyproject.toml"
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
# if this is a forked repository. Skipping the workflow.
if: github.event.repository.fork == false
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
with:
## Add your own personal access token to your Github Repository secrets and reference it here.
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+8
View File
@@ -0,0 +1,8 @@
0.2
* Added textbox to change model (must match downloaded model) and dropdown list to choose sampler
* Renamed wrapper node to Txt2Img
0.1
* Functional Txt2Img
+8 -4
View File
@@ -11,7 +11,7 @@ import io
import torch
class DrawThingsWrapper:
class DrawThingsTxt2Img:
def __init__(self):
pass
@@ -21,11 +21,13 @@ class DrawThingsWrapper:
def INPUT_TYPES(cls):
return {
"required": {
"model": ("STRING", {"default": "flux_1_dev_q8p.ckpt"}),
"prompt": ("STRING", {"default": ""}),
"seed": ("INT", {"default": 42}),
"width": ("INT", {"default": 512}),
"height": ("INT", {"default": 512}),
"guidance_scale": ("FLOAT", {"default": 3.5}),
"sampler": (["UniPC","DPM++ 2M Karras","Euler Ancestral", "DPM++ SDE Karras", "PLMS", "DDIM", "LCM", "Euler A Substep", "DPM++ SDE Substep", "TCD", "DPM++ 2M Trailing", "Euler A Trailing", "DPM++ SDE Trailing", "DDIM Trailing", "DPM++ 2M AYS", "Euler A AYS", "DPM++ SDE AYS"], {"default": "Euler A Trailing"}),
"steps": ("INT", {"default": 20}),
}
}
@@ -34,16 +36,18 @@ class DrawThingsWrapper:
RETURN_NAMES = ("generated_image",)
FUNCTION = "generate_image"
def generate_image(self, prompt, seed, width, height, guidance_scale, steps):
def generate_image(self, model, prompt, seed, width, height, guidance_scale, sampler, steps):
# Call the Draw Things API
api_url = "http://127.0.0.1:7860/sdapi/v1/txt2img"
payload = {
"model": model,
"prompt": prompt,
"seed": seed,
"width": width,
"height": height,
"guidance_scale": guidance_scale,
"sampler": sampler,
"steps": steps,
}
@@ -68,6 +72,6 @@ class DrawThingsWrapper:
return (torch.stack(images),)
NODE_CLASS_MAPPINGS = {"DrawThingsWrapper": DrawThingsWrapper}
NODE_CLASS_MAPPINGS = {"DrawThingsTxt2Img": DrawThingsTxt2Img}
NODE_DISPLAY_NAME_MAPPINGS = {"DrawThingsWrapper": "Draw Things Wrapper"}
NODE_DISPLAY_NAME_MAPPINGS = {"DrawThingsTxt2Img": "Draw Things Txt2Img"}