mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
@@ -264,6 +264,7 @@ class YoloRestorer(Detailer):
|
||||
|
||||
mask_all = []
|
||||
p.state = ''
|
||||
prev_state = shared.state.job
|
||||
for item in items:
|
||||
if item.mask is None:
|
||||
continue
|
||||
@@ -271,6 +272,7 @@ class YoloRestorer(Detailer):
|
||||
p.image_mask = [item.mask]
|
||||
# mask_all.append(item.mask)
|
||||
p.recursion = True
|
||||
shared.state.job = 'Detailer'
|
||||
pp = processing.process_images_inner(p)
|
||||
del p.recursion
|
||||
p.overlay_images = None # skip applying overlay twice
|
||||
@@ -289,6 +291,7 @@ class YoloRestorer(Detailer):
|
||||
p.image_mask = orig_p.get('image_mask', None)
|
||||
p.state = orig_p.get('state', None)
|
||||
p.ops = orig_p.get('ops', [])
|
||||
shared.state.job = prev_state
|
||||
shared.opts.data['mask_apply_overlay'] = orig_apply_overlay
|
||||
np_image = np.array(image)
|
||||
|
||||
|
||||
@@ -161,12 +161,12 @@ class State:
|
||||
import modules.sd_samplers # pylint: disable=W0621
|
||||
try:
|
||||
sample = self.current_latent
|
||||
if self.job == "txt2img" and self.job_no == 0 and self.current_noise_pred is not None and self.current_sigma is not None and self.current_sigma_next is not None:
|
||||
if self.job == "txt2img" and self.current_noise_pred is not None and self.current_sigma is not None and self.current_sigma_next is not None:
|
||||
original_sample = sample - (self.current_noise_pred * (self.current_sigma_next-self.current_sigma))
|
||||
if self.prediction_type in {"epsilon", "flow_prediction"}:
|
||||
sample = original_sample - (self.current_noise_pred * self.current_sigma)
|
||||
elif self.prediction_type == "v_prediction":
|
||||
sample = self.current_noise_pred * (-self.current_sigma / (self.current_sigma**2 + 1) ** 0.5) + (original_sample / (self.current_sigma**2 + 1))
|
||||
sample = self.current_noise_pred * (-self.current_sigma / (self.current_sigma**2 + 1) ** 0.5) + (original_sample / (self.current_sigma**2 + 1)) # pylint: disable=invalid-unary-operand-type
|
||||
image = modules.sd_samplers.samples_to_image_grid(sample) if opts.show_progress_grid else modules.sd_samplers.sample_to_image(sample)
|
||||
self.assign_current_image(image)
|
||||
self.current_image_sampling_step = self.sampling_step
|
||||
|
||||
@@ -22,7 +22,7 @@ def draw_xyz_grid(p, xs, ys, zs, x_labels, y_labels, z_labels, cell, draw_legend
|
||||
def index(ix, iy, iz):
|
||||
return ix + iy * len(xs) + iz * len(xs) * len(ys)
|
||||
|
||||
shared.state.job = 'grid'
|
||||
shared.state.job = 'Grid'
|
||||
p0 = time.time()
|
||||
processed: processing.Processed = cell(x, y, z, ix, iy, iz)
|
||||
p1 = time.time()
|
||||
|
||||
Reference in New Issue
Block a user