This commit is contained in:
lvmin
2023-08-10 05:29:12 -07:00
parent a6ec0509fd
commit 2d090cf484
4 changed files with 39 additions and 20 deletions
+20 -4
View File
@@ -1,4 +1,6 @@
import os
import random
from comfy.sd import load_checkpoint_guess_config
from nodes import (
@@ -11,7 +13,6 @@ from nodes import (
from modules.path import modelfile_path
xl_base_filename = os.path.join(modelfile_path, 'sd_xl_base_1.0.safetensors')
xl_refiner_filename = os.path.join(modelfile_path, 'sd_xl_refiner_1.0.safetensors')
@@ -22,10 +23,25 @@ opCLIPTextEncode = CLIPTextEncode()
opEmptyLatentImage = EmptyLatentImage()
opKSamplerAdvanced = KSamplerAdvanced()
positive_conditions = opCLIPTextEncode.encode(clip=xl_base_clip, text='a handsome man in forest')[0]
negative_conditions = opCLIPTextEncode.encode(clip=xl_base_clip, text='bad, ugly')[0]
positive_embedding = opCLIPTextEncode.encode(clip=xl_base_clip, text='a handsome man in forest')
negative_embedding = opCLIPTextEncode.encode(clip=xl_base_clip, text='bad, ugly')
initial_latent_image = opEmptyLatentImage.generate(width=1024, height=1536, batch_size=1)[0]
initial_latent_image = opEmptyLatentImage.generate(width=1024, height=1536, batch_size=1)
samples = opKSamplerAdvanced.sample(
add_noise="enable",
noise_seed=random.randint(1, 2 ** 64),
steps=25,
cfg=9,
sampler_name="euler",
scheduler="normal",
start_at_step=0,
end_at_step=25,
return_with_leftover_noise="enable",
model=xl_base,
positive=positive_conditions,
negative=negative_conditions,
latent_image=initial_latent_image,
)
a = 0