mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-10 10:50:09 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -295,6 +295,7 @@ def apply_filename_pattern(x, p, seed, prompt):
|
||||
|
||||
x = x.replace("[model_hash]", shared.sd_model.sd_model_hash)
|
||||
x = x.replace("[date]", datetime.date.today().isoformat())
|
||||
x = x.replace("[job_timestamp]", shared.state.job_timestamp)
|
||||
|
||||
if cmd_opts.hide_ui_dir_config:
|
||||
x = re.sub(r'^[\\/]+|\.{2,}[\\/]+|[\\/]+\.{2,}', '', x)
|
||||
|
@@ -119,6 +119,7 @@ class ScriptRunner:
|
||||
continue
|
||||
|
||||
for control in controls:
|
||||
control.custom_script_source = os.path.basename(script.filename)
|
||||
control.visible = False
|
||||
|
||||
inputs += controls
|
||||
|
@@ -4,6 +4,7 @@ import json
|
||||
import os
|
||||
import gradio as gr
|
||||
import tqdm
|
||||
import datetime
|
||||
|
||||
import modules.artists
|
||||
from modules.paths import script_path, sd_path
|
||||
@@ -65,6 +66,7 @@ class State:
|
||||
job = ""
|
||||
job_no = 0
|
||||
job_count = 0
|
||||
job_timestamp = 0
|
||||
sampling_step = 0
|
||||
sampling_steps = 0
|
||||
current_latent = None
|
||||
@@ -78,6 +80,8 @@ class State:
|
||||
self.job_no += 1
|
||||
self.sampling_step = 0
|
||||
self.current_image_sampling_step = 0
|
||||
def get_job_timestamp(self):
|
||||
return datetime.datetime.now().strftime("%Y%m%d%H%M%S")
|
||||
|
||||
|
||||
state = State()
|
||||
|
@@ -1040,6 +1040,9 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
|
||||
def loadsave(path, x):
|
||||
def apply_field(obj, field, condition=None):
|
||||
key = path + "/" + field
|
||||
|
||||
if getattr(obj,'custom_script_source',None) is not None:
|
||||
key = 'customscript/' + obj.custom_script_source + '/' + key
|
||||
|
||||
if getattr(obj, 'do_not_save_to_config', False):
|
||||
return
|
||||
|
Reference in New Issue
Block a user