Skip to content

Commit

Permalink
Merge branch 'main' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonRide303 committed Sep 20, 2023
2 parents f95f086 + cdf6424 commit 6b9d5e4
Show file tree
Hide file tree
Showing 8 changed files with 530 additions and 23 deletions.
2 changes: 1 addition & 1 deletion fooocus_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = '2.0.73 MRE'
version = '2.0.76 MRE'
full_version = 'Fooocus ' + version
11 changes: 3 additions & 8 deletions modules/async_worker.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import threading

import numpy as np
import torch

buffer = []
outputs = []
default_image = None


def worker():
global buffer, outputs, default_image
global buffer, outputs

import os
import json
import numpy as np
import torch
import time
import shared
import random
Expand Down Expand Up @@ -68,8 +67,6 @@ def progressbar(number, text):
@torch.no_grad()
@torch.inference_mode()
def handler(task):
global default_image

prompt, negative_prompt, style_selections, performance, resolution, image_number, image_seed, \
sharpness, sampler_name, scheduler, custom_steps, custom_switch, cfg, \
base_model_name, refiner_model_name, base_clip_skip, refiner_clip_skip, \
Expand Down Expand Up @@ -129,7 +126,6 @@ def handler(task):
progressbar(0, 'Image processing ...')
if current_tab == 'uov' and uov_method != flags.disabled and uov_input_image is not None:
uov_input_image = HWC3(uov_input_image)
default_image = uov_input_image
if 'vary' in uov_method:
if not image_is_generated_in_current_ui(uov_input_image, ui_width=width, ui_height=height):
uov_input_image = resize_image(uov_input_image, width=width, height=height)
Expand Down Expand Up @@ -207,7 +203,6 @@ def handler(task):
if current_tab == 'inpaint' and isinstance(inpaint_input_image, dict):
inpaint_image = inpaint_input_image['image']
inpaint_mask = inpaint_input_image['mask'][:, :, 0]
default_image = inpaint_image
if isinstance(inpaint_image, np.ndarray) and isinstance(inpaint_mask, np.ndarray) \
and (np.any(inpaint_mask > 127) or len(outpaint_selections) > 0):
if len(outpaint_selections) > 0:
Expand Down
7 changes: 5 additions & 2 deletions modules/core.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from modules.patch import patch_all

patch_all()


import os
import random
import einops
Expand All @@ -16,11 +21,9 @@
from comfy.model_base import SDXLRefiner
from comfy.lora import model_lora_keys_unet, model_lora_keys_clip, load_lora
from modules.samplers_advanced import KSamplerBasic, KSamplerWithRefiner
from modules.patch import patch_all
from modules.path import embeddings_path


patch_all()
opEmptyLatentImage = EmptyLatentImage()
opVAEDecode = VAEDecode()
opVAEEncode = VAEEncode()
Expand Down
2 changes: 1 addition & 1 deletion modules/default_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
callback_function=callback
)

decoded_latent = core.decode_vae(vae=xl_base_patched.vae, latent_image=sampled_latent)
decoded_latent = core.decode_vae(vae=xl_base_patched.vae, latent_image=sampled_latent, tiled=tiled)
images = core.pytorch_to_numpy(decoded_latent)

return images
Loading

0 comments on commit 6b9d5e4

Please sign in to comment.