1022 image_name = project_name + "_" + image_name 1023 path_name = project_name + "/" + path_name 1024 1025 random.seed(seed) 1026 number = random.randint (0, 18446744073709551615) 1027 1028 return (image_name, path_name, seed) 1029
96 single_line_prompt += " --seed_resize_from_w " + seed_resize_from_w 97 single_line_prompt += " --seed_resize_from_h " + seed_resize_from_h 98 try: 99 (tag, is_str) = A1111.PROMPT_MAPPING.get(key) 100 except: 101 pass 102 else: 103 if is_str: 104 single_line_prompt += " --" + tag + " " + add_quotes(str(value))
3 __copyright__ = "Copyright 2023" 4 __email__ = "receyuki@gmail.com" 5 6 import json 7 from xml.dom import minidom 8 9 import piexif 10 import piexif.helper
115 print("Fooocus format error") 116 # drawthings format 117 elif "XML:com.adobe.xmp" in self._info: 118 try: 119 data = minidom.parseString( 120 self._info.get("XML:com.adobe.xmp") 121 ) 122 data_json = json.loads( 123 data.getElementsByTagName("exif:UserComment")[0] 124 .childNodes[1]
148 piexif.ExifIFD.UserComment 149 ) 150 except TypeError: 151 print("empty jpeg") 152 except Exception: 153 pass 154 else: 155 # swarm format 156 if "sui_image_params" in user_comment[8:].decode("utf-16"):
147 CATEGORY = 'Style Prompts' 148 149 def prompt_styler(self, text_positive, text_negative, style, log_prompt, auto_select_style=False, auto_refresh=False): 150 if auto_select_style or auto_refresh: 151 style = random.choice([template['name'] for template in self.json_data]) 152 153 positive_prompt, negative_prompt = read_sdxl_templates_replace_and_combine(self.json_data, style, text_positive, text_negative) 154
1831 CATEGORY = 'Style Prompts' 1832 1833 def prompt_styler(self, text_positive, text_negative, style, log_prompt, random_style=False): 1834 if random_style: 1835 style = random.choice([template['name'] for template in self.json_data]) 1836 else: 1837 style = text_positive # You can change this to the appropriate parameter 1838