fix params.txt

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-06-25 09:11:17 -04:00
parent 77db759d88
commit b650618b27
7 changed files with 20 additions and 19 deletions
+5 -3
View File
@@ -1,10 +1,10 @@
# Change Log for SD.Next
## Update for 2025-06-24
## Update for 2025-06-25
- **Changes**
- Use Diffusers version of OmniGen
- Support Remote VAE with Omnigen, Lumina 2 and PixArt
- Use Diffusers version of *OmniGen*
- Support Remote VAE with *Omnigen, Lumina 2 and PixArt*
- **SDNQ Quantization**
- Add modules_to_not_convert support for post mode
@@ -18,6 +18,8 @@
- LTXVideo default scheduler
- Balanced offload with OmniGen
- Quantization with OmniGen
- Do not save empty `params.txt` file
- Override `params.txt` using `SD_PATH_PARAMS` env variable
## Update for 2025-06-16
+1 -1
View File
@@ -286,7 +286,7 @@ async function gallerySearch(evt) {
const findDuplicates = (arr, key) => {
const map = new Map();
return arr.filter(item => {
return arr.filter((item) => {
const value = item[key];
if (map.has(value)) return true;
map.set(value, true);
+3 -4
View File
@@ -3,7 +3,7 @@ import io
import os
from PIL import Image
import gradio as gr
from modules.paths import data_path
from modules.paths import params_path
from modules import shared, gr_tempdir, script_callbacks, images
from modules.infotext import parse, mapping, quote, unquote # pylint: disable=unused-import
@@ -223,9 +223,8 @@ def connect_paste(button, local_paste_fields, input_comp, override_settings_comp
def paste_func(prompt):
if prompt is None or len(prompt.strip()) == 0:
filename = os.path.join(data_path, "params.txt")
if os.path.exists(filename):
with open(filename, "r", encoding="utf8") as file:
if os.path.exists(params_path):
with open(params_path, "r", encoding="utf8") as file:
prompt = file.read()
shared.log.debug(f'Prompt parse: type="params" prompt="{prompt}"')
else:
+3 -2
View File
@@ -74,8 +74,9 @@ def pil_to_temp_file(self, img: Image, dir: str, format="png") -> str: # pylint:
shared.state.image_history += 1
params = ', '.join([f'{k}: {v}' for k, v in img.info.items()])
params = params[12:] if params.startswith('parameters: ') else params
with open(os.path.join(paths.data_path, "params.txt"), "w", encoding="utf8") as file:
file.write(params)
if len(params) > 2:
with open(paths.params_path, "w", encoding="utf8") as file:
file.write(params)
return name
+3 -3
View File
@@ -26,7 +26,6 @@ except Exception:
pass
def sanitize_filename_part(text, replace_spaces=True):
if text is None:
return None
@@ -47,8 +46,9 @@ def atomically_save_image():
while True:
image, filename, extension, params, exifinfo, filename_txt = save_queue.get()
shared.state.image_history += 1
with open(os.path.join(paths.data_path, "params.txt"), "w", encoding="utf8") as file:
file.write(exifinfo)
if len(exifinfo) > 2:
with open(paths.params_path, "w", encoding="utf8") as file:
file.write(exifinfo)
fn = filename + extension
filename = filename.strip()
if extension[0] != '.': # add dot if missing
+1
View File
@@ -29,6 +29,7 @@ script_path = os.path.dirname(modules_path)
data_path = cli.data_dir
models_config = cli.models_dir or config.get('models_dir') or 'models'
models_path = models_config if os.path.isabs(models_config) else os.path.join(data_path, models_config)
params_path = os.environ.get('SD_PATH_PARAMS', os.path.join(data_path, "params.txt"))
extensions_dir = cli.extensions_dir or os.path.join(data_path, "extensions")
extensions_builtin_dir = "extensions-builtin"
sd_configs_path = os.path.join(script_path, "configs")
+4 -6
View File
@@ -941,9 +941,8 @@ def create_ui(container, button_parent, tabname, skip_indexing = False):
from modules.processing_info import get_last_args
params, text = get_last_args()
if (not params) or (not text) or (len(text) == 0):
filename = os.path.join(paths.data_path, "params.txt")
if os.path.exists(filename):
with open(filename, "r", encoding="utf8") as file:
if os.path.exists(paths.params_path):
with open(paths.params_path, "r", encoding="utf8") as file:
text = file.read()
else:
text = ''
@@ -960,9 +959,8 @@ def create_ui(container, button_parent, tabname, skip_indexing = False):
from modules.processing_info import get_last_args
params, text = get_last_args()
if (not params) or (not text) or (len(text) == 0):
fn = os.path.join(paths.data_path, "params.txt")
if os.path.exists(fn):
with open(fn, "r", encoding="utf8") as file:
if os.path.exists(paths.params_path):
with open(paths.params_path, "r", encoding="utf8") as file:
text = file.read()
else:
text = ''