diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d14b8d4e..7055d9ddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,10 @@ - **UI** - modernui checkbox/radio styling - **Fixes** - - fix Wan2.2 5B I2V workflow + - fix Wan 2.2-5B I2V workflow - fix inpaint image metadata - fix processing image save loop + - fix progress bar with refine/detailer - fix api progress reporting endpoint - add missing interrogate in output panel diff --git a/modules/api/server.py b/modules/api/server.py index b9a471fc7..b459ed605 100644 --- a/modules/api/server.py +++ b/modules/api/server.py @@ -94,6 +94,9 @@ def get_progress(req: models.ReqProgress = Depends()): batch_x = max(shared.state.job_no, 0) batch_y = max(shared.state.job_count, 1) step_x = max(shared.state.sampling_step, 0) + prev_steps = max(shared.state.sampling_steps, 1) + while step_x > shared.state.sampling_steps: + shared.state.sampling_steps += prev_steps step_y = max(shared.state.sampling_steps, 1) current = step_y * batch_x + step_x total = step_y * batch_y @@ -101,6 +104,7 @@ def get_progress(req: models.ReqProgress = Depends()): time_since_start = time.time() - shared.state.time_start eta_relative = (time_since_start / progress) - time_since_start if progress > 0 else 0 # shared.log.critical(f'get_progress: batch {batch_x}/{batch_y} step {step_x}/{step_y} current {current}/{total} time={time_since_start} eta={eta_relative}') + # shared.log.critical(shared.state) res = models.ResProgress(id=shared.state.id, progress=round(progress, 2), eta_relative=round(eta_relative, 2), current_image=current_image, textinfo=shared.state.textinfo, state=shared.state.dict(), ) return res diff --git a/modules/generation_parameters_copypaste.py b/modules/generation_parameters_copypaste.py index 75893417e..3d667d8d4 100644 --- a/modules/generation_parameters_copypaste.py +++ b/modules/generation_parameters_copypaste.py @@ -237,8 +237,10 @@ def connect_paste(button, local_paste_fields, input_comp, override_settings_comp if hasattr(output, "step") and type(output.step) == float: valtype = float debug(f'Paste: "{key}"="{v}" type={valtype} var={vars(output)}') - if valtype == bool and v == "False": - val = False + if valtype == bool: + val = False if v.lower() == "false" else True + elif valtype == list: + val = v if isinstance(v, list) else [item.strip() for item in v.split(',')] else: val = valtype(v) res.append(gr.update(value=val)) diff --git a/modules/processing_helpers.py b/modules/processing_helpers.py index 17d1f52c7..4777463ba 100644 --- a/modules/processing_helpers.py +++ b/modules/processing_helpers.py @@ -507,7 +507,7 @@ def update_sampler(p, sd_model, second_pass=False): def get_job_name(p, model): if hasattr(model, 'pipe'): model = model.pipe - if hasattr(p, 'xyz'): + if getattr(p, 'xyz', False): return 'Ignore' # xyz grid handles its own jobs if sd_models.get_diffusers_task(model) == sd_models.DiffusersTaskType.TEXT_2_IMAGE: return 'Text' diff --git a/modules/shared_state.py b/modules/shared_state.py index b9f975d1a..c7c1cb472 100644 --- a/modules/shared_state.py +++ b/modules/shared_state.py @@ -231,7 +231,7 @@ class State: self.sampling_steps = steps self.job_count = jobs else: - self.sampling_steps += steps * jobs + self.sampling_steps += (steps * jobs) self.job_count += jobs self.job = job self.history('update') diff --git a/modules/styles.py b/modules/styles.py index 4e09be073..f8bf3e916 100644 --- a/modules/styles.py +++ b/modules/styles.py @@ -368,6 +368,9 @@ class StyleDatabase: return for style in p.styles: s = self.find_style(style) + if s == self.no_style: + shared.log.warning(f'Apply style: name="{style}" not found') + continue apply_styles_to_extra(p, s) def extract_comments(self, p): diff --git a/modules/ui_control.py b/modules/ui_control.py index 778ba5515..8d048da97 100644 --- a/modules/ui_control.py +++ b/modules/ui_control.py @@ -619,6 +619,7 @@ def create_ui(_blocks: gr.Blocks=None): # prompt (prompt, "Prompt"), (negative, "Negative prompt"), + (styles, "Styles"), # input (denoising_strength, "Denoising strength"), # size basic diff --git a/modules/ui_img2img.py b/modules/ui_img2img.py index 15490b1b7..6d23a9f37 100644 --- a/modules/ui_img2img.py +++ b/modules/ui_img2img.py @@ -236,6 +236,7 @@ def create_ui(): # prompt (img2img_prompt, "Prompt"), (img2img_negative_prompt, "Negative prompt"), + (img2img_prompt_styles, "Styles"), # sampler (sampler_index, "Sampler"), (steps, "Steps"), diff --git a/modules/ui_txt2img.py b/modules/ui_txt2img.py index 2db05ccea..e610305e7 100644 --- a/modules/ui_txt2img.py +++ b/modules/ui_txt2img.py @@ -92,6 +92,7 @@ def create_ui(): # prompt (txt2img_prompt, "Prompt"), (txt2img_negative_prompt, "Negative prompt"), + (txt2img_prompt_styles, "Styles"), # main (width, "Size-1"), (height, "Size-2"),