mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
i
This commit is contained in:
+4
-3
@@ -72,6 +72,10 @@ def get_previewer(device, latent_format):
|
|||||||
return taesd
|
return taesd
|
||||||
|
|
||||||
|
|
||||||
|
def close_all_preview():
|
||||||
|
cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
@torch.no_grad()
|
@torch.no_grad()
|
||||||
def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=9.0, sampler_name='euler_ancestral', scheduler='normal', denoise=1.0, disable_noise=False, start_step=None, last_step=None, force_full_denoise=False):
|
def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=9.0, sampler_name='euler_ancestral', scheduler='normal', denoise=1.0, disable_noise=False, start_step=None, last_step=None, force_full_denoise=False):
|
||||||
seed = seed if isinstance(seed, int) else random.randint(1, 2 ** 64)
|
seed = seed if isinstance(seed, int) else random.randint(1, 2 ** 64)
|
||||||
@@ -104,9 +108,6 @@ def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=9.0, sa
|
|||||||
out = latent.copy()
|
out = latent.copy()
|
||||||
out["samples"] = samples
|
out["samples"] = samples
|
||||||
|
|
||||||
if previewer:
|
|
||||||
cv2.destroyAllWindows()
|
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,4 +42,7 @@ def process(positive_prompt, negative_prompt, width=1024, height=1024, batch_siz
|
|||||||
decoded_latent = core.decode_vae(vae=xl_refiner.vae, latent_image=sampled_latent)
|
decoded_latent = core.decode_vae(vae=xl_refiner.vae, latent_image=sampled_latent)
|
||||||
|
|
||||||
images = core.image_to_numpy(decoded_latent)
|
images = core.image_to_numpy(decoded_latent)
|
||||||
|
|
||||||
|
core.close_all_preview()
|
||||||
|
|
||||||
return images
|
return images
|
||||||
|
|||||||
Reference in New Issue
Block a user