From 9dbca41dcc2a2fc58c68217b8baad76bd6567fab Mon Sep 17 00:00:00 2001 From: Ben Chanapai Date: Sat, 3 May 2025 22:52:40 +0700 Subject: [PATCH] Add final translations --- .gitignore | 2 +- extensions/adetailer | 1 + modules/processing_scripts/refiner.py | 6 +++--- modules/processing_scripts/sampler.py | 4 ++-- modules/ui.py | 13 ++++++------- style.css | 4 ++++ 6 files changed, 17 insertions(+), 13 deletions(-) create mode 160000 extensions/adetailer diff --git a/.gitignore b/.gitignore index e81ad31f5..9f8ee8590 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,7 @@ notification.mp3 /SwinIR /textual_inversion .vscode -/extensions +# /extensions /test/stdout.txt /test/stderr.txt /cache.json* diff --git a/extensions/adetailer b/extensions/adetailer new file mode 160000 index 000000000..36189cbea --- /dev/null +++ b/extensions/adetailer @@ -0,0 +1 @@ +Subproject commit 36189cbea735b85fd01e98ac42002b8ce6f0e41d diff --git a/modules/processing_scripts/refiner.py b/modules/processing_scripts/refiner.py index ba33d8a4b..e86cffe65 100644 --- a/modules/processing_scripts/refiner.py +++ b/modules/processing_scripts/refiner.py @@ -20,12 +20,12 @@ class ScriptRefiner(scripts.ScriptBuiltinUI): return scripts.AlwaysVisible def ui(self, is_img2img): - with InputAccordion(False, label="Refiner", elem_id=self.elem_id("enable")) as enable_refiner: + with InputAccordion(False, label="ตัวปรับแต่ง", elem_id=self.elem_id("enable")) as enable_refiner: with gr.Row(): - refiner_checkpoint = gr.Dropdown(label='Checkpoint', elem_id=self.elem_id("checkpoint"), choices=sd_models.checkpoint_tiles(), value='', tooltip="switch to another model in the middle of generation") + refiner_checkpoint = gr.Dropdown(label='เช็คพอยต์', elem_id=self.elem_id("checkpoint"), choices=sd_models.checkpoint_tiles(), value='', tooltip="สลับไปยังโมเดลอื่นระหว่างการสร้างภาพ") create_refresh_button(refiner_checkpoint, sd_models.list_models, lambda: {"choices": sd_models.checkpoint_tiles()}, self.elem_id("checkpoint_refresh")) - refiner_switch_at = gr.Slider(value=0.8, label="Switch at", minimum=0.01, maximum=1.0, step=0.01, elem_id=self.elem_id("switch_at"), tooltip="fraction of sampling steps when the switch to refiner model should happen; 1=never, 0.5=switch in the middle of generation") + refiner_switch_at = gr.Slider(value=0.8, label="สลับที่", minimum=0.01, maximum=1.0, step=0.01, elem_id=self.elem_id("switch_at"), tooltip="สัดส่วนของขั้นตอนการสร้างภาพที่จะสลับไปใช้โมเดล refiner; 1=ไม่สลับ, 0.5=สลับกลางทาง") def lookup_checkpoint(title): info = sd_models.get_closet_checkpoint_match(title) diff --git a/modules/processing_scripts/sampler.py b/modules/processing_scripts/sampler.py index 2005d6d81..6a24561d6 100644 --- a/modules/processing_scripts/sampler.py +++ b/modules/processing_scripts/sampler.py @@ -23,13 +23,13 @@ class ScriptSampler(scripts.ScriptBuiltinUI): if shared.opts.samplers_in_dropdown: with FormRow(elem_id=f"sampler_selection_{self.tabname}"): self.sampler_name = gr.Dropdown(label='วิธีเรนเดอร์', elem_id=f"{self.tabname}_sampling", choices=sampler_names, value=sampler_names[0]) - self.scheduler = gr.Dropdown(label='Schedule type', elem_id=f"{self.tabname}_scheduler", choices=scheduler_names, value=scheduler_names[0]) + self.scheduler = gr.Dropdown(label='กำหนดการ', elem_id=f"{self.tabname}_scheduler", choices=scheduler_names, value=scheduler_names[0]) self.steps = gr.Slider(minimum=1, maximum=150, step=1, elem_id=f"{self.tabname}_steps", label="ขั้นตอน", value=20) else: with FormGroup(elem_id=f"sampler_selection_{self.tabname}"): self.steps = gr.Slider(minimum=1, maximum=150, step=1, elem_id=f"{self.tabname}_steps", label="ขั้นตอน", value=20) self.sampler_name = gr.Radio(label='วิธีเรนเดอร์', elem_id=f"{self.tabname}_sampling", choices=sampler_names, value=sampler_names[0]) - self.scheduler = gr.Dropdown(label='Schedule type', elem_id=f"{self.tabname}_scheduler", choices=scheduler_names, value=scheduler_names[0]) + self.scheduler = gr.Dropdown(label='กำหนดการ', elem_id=f"{self.tabname}_scheduler", choices=scheduler_names, value=scheduler_names[0]) self.infotext_fields = [ PasteField(self.steps, "Steps", api="steps"), diff --git a/modules/ui.py b/modules/ui.py index 29599ae95..c34491741 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -314,14 +314,14 @@ def create_ui(): hr_final_resolution = FormHTML(value="", elem_id="txtimg_hr_finalres", label="Upscaled resolution", interactive=False, min_width=0) with FormRow(elem_id="txt2img_hires_fix_row1", variant="compact"): - hr_upscaler = gr.Dropdown(label="Upscaler", elem_id="txt2img_hr_upscaler", choices=[*shared.latent_upscale_modes, *[x.name for x in shared.sd_upscalers]], value=shared.latent_upscale_default_mode) - hr_second_pass_steps = gr.Slider(minimum=0, maximum=150, step=1, label='Hires steps', value=0, elem_id="txt2img_hires_steps") - denoising_strength = gr.Slider(minimum=0.0, maximum=1.0, step=0.01, label='Denoising strength', value=0.7, elem_id="txt2img_denoising_strength") + hr_upscaler = gr.Dropdown(label="ตัวขยายภาพ", elem_id="txt2img_hr_upscaler", choices=[*shared.latent_upscale_modes, *[x.name for x in shared.sd_upscalers]], value=shared.latent_upscale_default_mode) + hr_second_pass_steps = gr.Slider(minimum=0, maximum=150, step=1, label='ขั้นตอนความละเอียดสูง', value=0, elem_id="txt2img_hires_steps") + denoising_strength = gr.Slider(minimum=0.0, maximum=1.0, step=0.01, label='ความแรงในการลดสัญญาณรบกวน', value=0.7, elem_id="txt2img_denoising_strength") with FormRow(elem_id="txt2img_hires_fix_row2", variant="compact"): - hr_scale = gr.Slider(minimum=1.0, maximum=4.0, step=0.05, label="Upscale by", value=2.0, elem_id="txt2img_hr_scale") - hr_resize_x = gr.Slider(minimum=0, maximum=2048, step=8, label="Resize width to", value=0, elem_id="txt2img_hr_resize_x") - hr_resize_y = gr.Slider(minimum=0, maximum=2048, step=8, label="Resize height to", value=0, elem_id="txt2img_hr_resize_y") + hr_scale = gr.Slider(minimum=1.0, maximum=4.0, step=0.05, label="ขยายขนาดคูณ", value=2.0, elem_id="txt2img_hr_scale") + hr_resize_x = gr.Slider(minimum=0, maximum=2048, step=8, label="ปรับความกว้างเป็น", value=0, elem_id="txt2img_hr_resize_x") + hr_resize_y = gr.Slider(minimum=0, maximum=2048, step=8, label="ปรับความสูงเป็น", value=0, elem_id="txt2img_hr_resize_y") with FormRow(elem_id="txt2img_hires_fix_row3", variant="compact", visible=opts.hires_fix_show_sampler) as hr_sampler_container: @@ -340,7 +340,6 @@ def create_ui(): hr_negative_prompt = gr.Textbox(label="Hires negative prompt", elem_id="hires_neg_prompt", show_label=False, lines=3, placeholder="Negative prompt for hires fix pass.\nLeave empty to use the same negative prompt as in first pass.", elem_classes=["prompt"]) scripts.scripts_txt2img.setup_ui_for_section(category) - elif category == "batch": if not opts.dimensions_and_batch_together: with FormRow(elem_id="txt2img_column_batch"): diff --git a/style.css b/style.css index 22bc1c834..29613ec14 100644 --- a/style.css +++ b/style.css @@ -1730,4 +1730,8 @@ body.resizing .resize-handle { background-color: #F703CE !important; padding: 4px 8px 4px 8px !important; border-radius: 8px !important; +} + +#settings_restart_gradio, #settings_submit { + background-color: #F703CE !important; } \ No newline at end of file