magicfixeseverything
commited on
Commit
·
16af102
1
Parent(s):
6fd0800
Upload 2 files
Browse files- ai_image_creation.zip +2 -2
- app.py +61 -75
ai_image_creation.zip
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:163482494cf2af1d09c3036ff78216c458893596d7e8e0d7680094f33f1e44f3
|
3 |
+
size 25554
|
app.py
CHANGED
@@ -1393,6 +1393,12 @@ def toggle_interactivity_during_image_creation (
|
|
1393 |
interactive = interactivity
|
1394 |
)
|
1395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1396 |
refining_selection_default_config_field_update = gr.Radio(
|
1397 |
interactive = interactivity
|
1398 |
)
|
@@ -1474,8 +1480,8 @@ def toggle_interactivity_during_image_creation (
|
|
1474 |
)
|
1475 |
|
1476 |
return {
|
1477 |
-
|
1478 |
-
|
1479 |
refining_selection_default_config_field: refining_selection_default_config_field_update,
|
1480 |
refining_denoise_start_for_default_config_field: refining_denoise_start_for_default_config_field_update,
|
1481 |
refining_use_denoising_start_in_base_model_when_using_refiner_field: refining_use_denoising_start_in_base_model_when_using_refiner_field_update,
|
@@ -1502,27 +1508,6 @@ def toggle_interactivity_during_image_creation (
|
|
1502 |
|
1503 |
|
1504 |
|
1505 |
-
#####################
|
1506 |
-
#
|
1507 |
-
# Disable Form Function
|
1508 |
-
#
|
1509 |
-
# Disable most form inputs during image generation
|
1510 |
-
#
|
1511 |
-
#####################
|
1512 |
-
|
1513 |
-
def disable_form_function ():
|
1514 |
-
|
1515 |
-
toggled_interactivity_fields_kwargs = toggle_interactivity_during_image_creation(False)
|
1516 |
-
|
1517 |
-
return {
|
1518 |
-
**toggled_interactivity_fields_kwargs
|
1519 |
-
}
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
#####################
|
1527 |
#
|
1528 |
# Before Create Image Function
|
@@ -1549,10 +1534,15 @@ def before_create_image_function ():
|
|
1549 |
every = 1
|
1550 |
)
|
1551 |
|
|
|
|
|
|
|
|
|
1552 |
return {
|
1553 |
generate_image_btn: generate_image_btn_update,
|
1554 |
output_text_field: output_text_field_update,
|
1555 |
-
log_text_field: log_text_field_update
|
|
|
1556 |
}
|
1557 |
|
1558 |
|
@@ -1587,7 +1577,9 @@ def after_create_image_function ():
|
|
1587 |
every = None
|
1588 |
)
|
1589 |
|
1590 |
-
toggled_interactivity_fields_kwargs = toggle_interactivity_during_image_creation(True)
|
|
|
|
|
1591 |
|
1592 |
return {
|
1593 |
generate_image_btn: generate_image_btn_update,
|
@@ -3640,37 +3632,31 @@ with gr.Blocks(
|
|
3640 |
generate_image_btn,
|
3641 |
output_image_field,
|
3642 |
output_text_field,
|
3643 |
-
log_text_field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3644 |
],
|
3645 |
show_progress = "minimal",
|
3646 |
queue = True
|
3647 |
-
).then(
|
3648 |
-
fn = disable_form_function,
|
3649 |
-
inputs = [],
|
3650 |
-
outputs = [
|
3651 |
-
prompt_field,
|
3652 |
-
negative_prompt_field,
|
3653 |
-
refining_selection_default_config_field,
|
3654 |
-
refining_denoise_start_for_default_config_field,
|
3655 |
-
refining_use_denoising_start_in_base_model_when_using_refiner_field,
|
3656 |
-
refining_base_model_output_to_refiner_is_in_latent_space_field,
|
3657 |
-
refining_selection_online_config_normal_field,
|
3658 |
-
refining_selection_online_config_automatically_selected_field,
|
3659 |
-
refining_denoise_start_for_online_config_field,
|
3660 |
-
refining_number_of_iterations_for_online_config_field,
|
3661 |
-
upscaling_selection_field,
|
3662 |
-
upscaling_num_inference_steps_field,
|
3663 |
-
base_model_field,
|
3664 |
-
model_configuration_field,
|
3665 |
-
image_width_field,
|
3666 |
-
image_height_field,
|
3667 |
-
base_model_num_inference_steps_field,
|
3668 |
-
base_model_num_inference_steps_field_for_sdxl_turbo_field,
|
3669 |
-
guidance_scale_field,
|
3670 |
-
seed_field
|
3671 |
-
],
|
3672 |
-
show_progress = "hidden",
|
3673 |
-
queue = False
|
3674 |
).then(
|
3675 |
fn = create_image_function,
|
3676 |
inputs = [
|
@@ -3711,28 +3697,28 @@ with gr.Blocks(
|
|
3711 |
outputs = [
|
3712 |
generate_image_btn,
|
3713 |
output_text_field,
|
3714 |
-
log_text_field
|
3715 |
-
|
3716 |
-
prompt_field,
|
3717 |
-
negative_prompt_field,
|
3718 |
-
refining_selection_default_config_field,
|
3719 |
-
refining_denoise_start_for_default_config_field,
|
3720 |
-
refining_use_denoising_start_in_base_model_when_using_refiner_field,
|
3721 |
-
refining_base_model_output_to_refiner_is_in_latent_space_field,
|
3722 |
-
refining_selection_online_config_normal_field,
|
3723 |
-
refining_selection_online_config_automatically_selected_field,
|
3724 |
-
refining_denoise_start_for_online_config_field,
|
3725 |
-
refining_number_of_iterations_for_online_config_field,
|
3726 |
-
upscaling_selection_field,
|
3727 |
-
upscaling_num_inference_steps_field,
|
3728 |
-
base_model_field,
|
3729 |
-
model_configuration_field,
|
3730 |
-
image_width_field,
|
3731 |
-
image_height_field,
|
3732 |
-
base_model_num_inference_steps_field,
|
3733 |
-
base_model_num_inference_steps_field_for_sdxl_turbo_field,
|
3734 |
-
guidance_scale_field,
|
3735 |
-
seed_field
|
3736 |
],
|
3737 |
queue = False
|
3738 |
)
|
|
|
1393 |
interactive = interactivity
|
1394 |
)
|
1395 |
|
1396 |
+
else:
|
1397 |
+
|
1398 |
+
prompt_field_update = gr.Textbox()
|
1399 |
+
|
1400 |
+
negative_prompt_field_update = gr.Textbox()
|
1401 |
+
|
1402 |
refining_selection_default_config_field_update = gr.Radio(
|
1403 |
interactive = interactivity
|
1404 |
)
|
|
|
1480 |
)
|
1481 |
|
1482 |
return {
|
1483 |
+
prompt_field: prompt_field_update,
|
1484 |
+
negative_prompt_field: negative_prompt_field_update,
|
1485 |
refining_selection_default_config_field: refining_selection_default_config_field_update,
|
1486 |
refining_denoise_start_for_default_config_field: refining_denoise_start_for_default_config_field_update,
|
1487 |
refining_use_denoising_start_in_base_model_when_using_refiner_field: refining_use_denoising_start_in_base_model_when_using_refiner_field_update,
|
|
|
1508 |
|
1509 |
|
1510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1511 |
#####################
|
1512 |
#
|
1513 |
# Before Create Image Function
|
|
|
1534 |
every = 1
|
1535 |
)
|
1536 |
|
1537 |
+
# toggled_interactivity_fields_kwargs = toggle_interactivity_during_image_creation(False)
|
1538 |
+
|
1539 |
+
toggled_interactivity_fields_kwargs = {}
|
1540 |
+
|
1541 |
return {
|
1542 |
generate_image_btn: generate_image_btn_update,
|
1543 |
output_text_field: output_text_field_update,
|
1544 |
+
log_text_field: log_text_field_update,
|
1545 |
+
**toggled_interactivity_fields_kwargs
|
1546 |
}
|
1547 |
|
1548 |
|
|
|
1577 |
every = None
|
1578 |
)
|
1579 |
|
1580 |
+
# toggled_interactivity_fields_kwargs = toggle_interactivity_during_image_creation(True)
|
1581 |
+
|
1582 |
+
toggled_interactivity_fields_kwargs = {}
|
1583 |
|
1584 |
return {
|
1585 |
generate_image_btn: generate_image_btn_update,
|
|
|
3632 |
generate_image_btn,
|
3633 |
output_image_field,
|
3634 |
output_text_field,
|
3635 |
+
log_text_field#,
|
3636 |
+
|
3637 |
+
#prompt_field,
|
3638 |
+
#negative_prompt_field,
|
3639 |
+
#refining_selection_default_config_field,
|
3640 |
+
#refining_denoise_start_for_default_config_field,
|
3641 |
+
#refining_use_denoising_start_in_base_model_when_using_refiner_field,
|
3642 |
+
#refining_base_model_output_to_refiner_is_in_latent_space_field,
|
3643 |
+
#refining_selection_online_config_normal_field,
|
3644 |
+
#refining_selection_online_config_automatically_selected_field,
|
3645 |
+
#refining_denoise_start_for_online_config_field,
|
3646 |
+
#refining_number_of_iterations_for_online_config_field,
|
3647 |
+
#upscaling_selection_field,
|
3648 |
+
#upscaling_num_inference_steps_field,
|
3649 |
+
#base_model_field,
|
3650 |
+
#model_configuration_field,
|
3651 |
+
#image_width_field,
|
3652 |
+
#image_height_field,
|
3653 |
+
#base_model_num_inference_steps_field,
|
3654 |
+
#base_model_num_inference_steps_field_for_sdxl_turbo_field,
|
3655 |
+
#guidance_scale_field,
|
3656 |
+
#seed_field
|
3657 |
],
|
3658 |
show_progress = "minimal",
|
3659 |
queue = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3660 |
).then(
|
3661 |
fn = create_image_function,
|
3662 |
inputs = [
|
|
|
3697 |
outputs = [
|
3698 |
generate_image_btn,
|
3699 |
output_text_field,
|
3700 |
+
log_text_field#,
|
3701 |
+
|
3702 |
+
#prompt_field,
|
3703 |
+
#negative_prompt_field,
|
3704 |
+
#refining_selection_default_config_field,
|
3705 |
+
#refining_denoise_start_for_default_config_field,
|
3706 |
+
#refining_use_denoising_start_in_base_model_when_using_refiner_field,
|
3707 |
+
#refining_base_model_output_to_refiner_is_in_latent_space_field,
|
3708 |
+
#refining_selection_online_config_normal_field,
|
3709 |
+
#refining_selection_online_config_automatically_selected_field,
|
3710 |
+
#refining_denoise_start_for_online_config_field,
|
3711 |
+
#refining_number_of_iterations_for_online_config_field,
|
3712 |
+
#upscaling_selection_field,
|
3713 |
+
#upscaling_num_inference_steps_field,
|
3714 |
+
#base_model_field,
|
3715 |
+
#model_configuration_field,
|
3716 |
+
#image_width_field,
|
3717 |
+
#image_height_field,
|
3718 |
+
#base_model_num_inference_steps_field,
|
3719 |
+
#base_model_num_inference_steps_field_for_sdxl_turbo_field,
|
3720 |
+
#guidance_scale_field,
|
3721 |
+
#seed_field
|
3722 |
],
|
3723 |
queue = False
|
3724 |
)
|