barreloflube
commited on
Commit
·
3d75865
1
Parent(s):
1d2edf1
Refactor image_tab function to update the Guidance Scale range
Browse files- tabs/images/events.py +2 -2
- tabs/images/handlers.py +1 -1
- tabs/images/ui.py +1 -1
tabs/images/events.py
CHANGED
@@ -16,7 +16,7 @@ def update_model_options(model):
|
|
16 |
visible=False
|
17 |
),
|
18 |
gr.update( # lora_gallery
|
19 |
-
value=Config.IMAGES_LORAS_FLUX
|
20 |
),
|
21 |
gr.update( # embeddings_accordion
|
22 |
visible=False
|
@@ -41,7 +41,7 @@ def update_model_options(model):
|
|
41 |
visible=True
|
42 |
),
|
43 |
gr.update( # lora_gallery
|
44 |
-
value=Config.IMAGES_LORAS_SDXL
|
45 |
),
|
46 |
gr.update( # embeddings_accordion
|
47 |
visible=True
|
|
|
16 |
visible=False
|
17 |
),
|
18 |
gr.update( # lora_gallery
|
19 |
+
value=[(lora['image'], lora['title']) for lora in Config.IMAGES_LORAS_FLUX]
|
20 |
),
|
21 |
gr.update( # embeddings_accordion
|
22 |
visible=False
|
|
|
41 |
visible=True
|
42 |
),
|
43 |
gr.update( # lora_gallery
|
44 |
+
value=[(lora['image'], lora['title']) for lora in Config.IMAGES_LORAS_SDXL]
|
45 |
),
|
46 |
gr.update( # embeddings_accordion
|
47 |
visible=True
|
tabs/images/handlers.py
CHANGED
@@ -213,7 +213,7 @@ def gen_img(request: BaseReq | BaseImg2ImgReq | BaseInpaintReq, progress=gr.Prog
|
|
213 |
progress(0.3, "Getting Prompt Embeddings")
|
214 |
# Get Prompt Embeddings
|
215 |
if isinstance(pipeline, flux_pipes):
|
216 |
-
positive_prompt_embeds, positive_prompt_pooled = get_weighted_text_embeddings_flux1(pipeline, request.prompt)
|
217 |
elif isinstance(pipeline, sd_pipes):
|
218 |
positive_prompt_embeds, negative_prompt_embeds, positive_prompt_pooled, negative_prompt_pooled = get_weighted_text_embeddings_sdxl(pipeline, request.prompt, request.negative_prompt)
|
219 |
|
|
|
213 |
progress(0.3, "Getting Prompt Embeddings")
|
214 |
# Get Prompt Embeddings
|
215 |
if isinstance(pipeline, flux_pipes):
|
216 |
+
positive_prompt_embeds, positive_prompt_pooled = get_weighted_text_embeddings_flux1(pipeline, request.prompt, device=device)
|
217 |
elif isinstance(pipeline, sd_pipes):
|
218 |
positive_prompt_embeds, negative_prompt_embeds, positive_prompt_pooled, negative_prompt_pooled = get_weighted_text_embeddings_sdxl(pipeline, request.prompt, request.negative_prompt)
|
219 |
|
tabs/images/ui.py
CHANGED
@@ -124,7 +124,7 @@ def image_tab():
|
|
124 |
("Num Images Per Prompt", "image_num_images_per_prompt", 1, 4, 1, 1, True),
|
125 |
("Num Inference Steps", "image_num_inference_steps", 1, 100, 1, 20, True),
|
126 |
("Clip Skip", "image_clip_skip", 0, 2, 1, 2, False),
|
127 |
-
("Guidance Scale", "image_guidance_scale", 0, 20, 0.5,
|
128 |
("Seed", "image_seed", 0, 100000, 1, random.randint(0, 100000), True),
|
129 |
]
|
130 |
for label, var_name, min_val, max_val, step, value, visible in options[column::2]:
|
|
|
124 |
("Num Images Per Prompt", "image_num_images_per_prompt", 1, 4, 1, 1, True),
|
125 |
("Num Inference Steps", "image_num_inference_steps", 1, 100, 1, 20, True),
|
126 |
("Clip Skip", "image_clip_skip", 0, 2, 1, 2, False),
|
127 |
+
("Guidance Scale", "image_guidance_scale", 0, 20, 0.5, 3.5, True),
|
128 |
("Seed", "image_seed", 0, 100000, 1, random.randint(0, 100000), True),
|
129 |
]
|
130 |
for label, var_name, min_val, max_val, step, value, visible in options[column::2]:
|