magicfixeseverything
commited on
Commit
·
1a8212d
1
Parent(s):
cabe417
Upload spaghetti_ai_script.py
Browse files- spaghetti_ai_script.py +17 -13
spaghetti_ai_script.py
CHANGED
@@ -3445,7 +3445,7 @@ def create_image_function (
|
|
3445 |
#print ("user_id_state_value: ", user_id_state_value)
|
3446 |
#print ("cancel_image_generation_ids_object: ", cancel_image_generation_ids_object)
|
3447 |
#print ("cancel_image_generation_times_object: ", cancel_image_generation_times_object)
|
3448 |
-
|
3449 |
|
3450 |
if image_processing_is_canceled(user_id_state_value, image_generation_id_state_value):
|
3451 |
|
@@ -3833,13 +3833,13 @@ def create_image_function (
|
|
3833 |
|
3834 |
global current_base_model_generation_start_time
|
3835 |
|
3836 |
-
if
|
3837 |
|
3838 |
current_base_model_generation_start_time = time.time()
|
3839 |
|
3840 |
seconds_per_step = 0
|
3841 |
|
3842 |
-
if
|
3843 |
|
3844 |
seconds_per_step = ((time.time() - current_base_model_generation_start_time) / int(callback_step_index))
|
3845 |
|
@@ -3867,7 +3867,7 @@ def create_image_function (
|
|
3867 |
|
3868 |
latents = callback_kwargs["latents"]
|
3869 |
|
3870 |
-
temporary_extra = str(user_id_state_value) + "_base_model_" + str(
|
3871 |
|
3872 |
model_to_use = base_model_name_value
|
3873 |
|
@@ -3906,7 +3906,7 @@ def create_image_function (
|
|
3906 |
|
3907 |
progress(
|
3908 |
progress = (
|
3909 |
-
|
3910 |
current_estimated_total_base_model_steps
|
3911 |
),
|
3912 |
desc = base_model_progress_text,
|
@@ -3934,19 +3934,21 @@ def create_image_function (
|
|
3934 |
callback_kwargs
|
3935 |
):
|
3936 |
|
|
|
|
|
3937 |
global current_actual_total_refiner_steps
|
3938 |
|
3939 |
current_actual_total_refiner_steps += 1
|
3940 |
|
3941 |
global current_refiner_generation_start_time
|
3942 |
|
3943 |
-
if
|
3944 |
|
3945 |
current_refiner_generation_start_time = time.time()
|
3946 |
|
3947 |
seconds_per_step = 0
|
3948 |
|
3949 |
-
if
|
3950 |
|
3951 |
seconds_per_step = ((time.time() - current_refiner_generation_start_time) / int(callback_step_index))
|
3952 |
|
@@ -3968,7 +3970,7 @@ def create_image_function (
|
|
3968 |
|
3969 |
latents = callback_kwargs["latents"]
|
3970 |
|
3971 |
-
temporary_extra = str(user_id_state_value) + "_refiner_" + str(
|
3972 |
|
3973 |
model_to_use = base_model_name_value
|
3974 |
|
@@ -3985,11 +3987,11 @@ def create_image_function (
|
|
3985 |
|
3986 |
progress(
|
3987 |
progress = (
|
3988 |
-
|
3989 |
current_estimated_total_refiner_steps
|
3990 |
),
|
3991 |
desc = refiner_progress_text,
|
3992 |
-
unit = "refiner steps"
|
3993 |
)
|
3994 |
|
3995 |
if image_processing_is_canceled(user_id_state_value, image_generation_id_state_value):
|
@@ -4010,19 +4012,21 @@ def create_image_function (
|
|
4010 |
callback_latents
|
4011 |
):
|
4012 |
|
|
|
|
|
4013 |
global current_actual_total_upscaler_steps
|
4014 |
|
4015 |
current_actual_total_upscaler_steps += 1
|
4016 |
|
4017 |
global current_upscaler_generation_start_time
|
4018 |
|
4019 |
-
if
|
4020 |
|
4021 |
current_upscaler_generation_start_time = time.time()
|
4022 |
|
4023 |
seconds_per_step = 0
|
4024 |
|
4025 |
-
if
|
4026 |
|
4027 |
seconds_per_step = ((time.time() - current_upscaler_generation_start_time) / int(callback_step_index))
|
4028 |
|
@@ -4061,7 +4065,7 @@ def create_image_function (
|
|
4061 |
|
4062 |
progress(
|
4063 |
progress = (
|
4064 |
-
|
4065 |
current_estimated_total_upscaler_steps
|
4066 |
),
|
4067 |
desc = upscaler_progress_text,
|
|
|
3445 |
#print ("user_id_state_value: ", user_id_state_value)
|
3446 |
#print ("cancel_image_generation_ids_object: ", cancel_image_generation_ids_object)
|
3447 |
#print ("cancel_image_generation_times_object: ", cancel_image_generation_times_object)
|
3448 |
+
print ("-------------------------")
|
3449 |
|
3450 |
if image_processing_is_canceled(user_id_state_value, image_generation_id_state_value):
|
3451 |
|
|
|
3833 |
|
3834 |
global current_base_model_generation_start_time
|
3835 |
|
3836 |
+
if callback_step_number == 1:
|
3837 |
|
3838 |
current_base_model_generation_start_time = time.time()
|
3839 |
|
3840 |
seconds_per_step = 0
|
3841 |
|
3842 |
+
if callback_step_number > 1:
|
3843 |
|
3844 |
seconds_per_step = ((time.time() - current_base_model_generation_start_time) / int(callback_step_index))
|
3845 |
|
|
|
3867 |
|
3868 |
latents = callback_kwargs["latents"]
|
3869 |
|
3870 |
+
temporary_extra = str(user_id_state_value) + "_base_model_" + str(callback_step_number)
|
3871 |
|
3872 |
model_to_use = base_model_name_value
|
3873 |
|
|
|
3906 |
|
3907 |
progress(
|
3908 |
progress = (
|
3909 |
+
callback_step_number,
|
3910 |
current_estimated_total_base_model_steps
|
3911 |
),
|
3912 |
desc = base_model_progress_text,
|
|
|
3934 |
callback_kwargs
|
3935 |
):
|
3936 |
|
3937 |
+
callback_step_number = (int(callback_step_index) + 1)
|
3938 |
+
|
3939 |
global current_actual_total_refiner_steps
|
3940 |
|
3941 |
current_actual_total_refiner_steps += 1
|
3942 |
|
3943 |
global current_refiner_generation_start_time
|
3944 |
|
3945 |
+
if callback_step_number == 1:
|
3946 |
|
3947 |
current_refiner_generation_start_time = time.time()
|
3948 |
|
3949 |
seconds_per_step = 0
|
3950 |
|
3951 |
+
if callback_step_number > 1:
|
3952 |
|
3953 |
seconds_per_step = ((time.time() - current_refiner_generation_start_time) / int(callback_step_index))
|
3954 |
|
|
|
3970 |
|
3971 |
latents = callback_kwargs["latents"]
|
3972 |
|
3973 |
+
temporary_extra = str(user_id_state_value) + "_refiner_" + str(callback_step_number)
|
3974 |
|
3975 |
model_to_use = base_model_name_value
|
3976 |
|
|
|
3987 |
|
3988 |
progress(
|
3989 |
progress = (
|
3990 |
+
callback_step_number,
|
3991 |
current_estimated_total_refiner_steps
|
3992 |
),
|
3993 |
desc = refiner_progress_text,
|
3994 |
+
unit = "est. refiner steps"
|
3995 |
)
|
3996 |
|
3997 |
if image_processing_is_canceled(user_id_state_value, image_generation_id_state_value):
|
|
|
4012 |
callback_latents
|
4013 |
):
|
4014 |
|
4015 |
+
callback_step_number = (int(callback_step_index) + 1)
|
4016 |
+
|
4017 |
global current_actual_total_upscaler_steps
|
4018 |
|
4019 |
current_actual_total_upscaler_steps += 1
|
4020 |
|
4021 |
global current_upscaler_generation_start_time
|
4022 |
|
4023 |
+
if callback_step_number == 1:
|
4024 |
|
4025 |
current_upscaler_generation_start_time = time.time()
|
4026 |
|
4027 |
seconds_per_step = 0
|
4028 |
|
4029 |
+
if callback_step_number > 1:
|
4030 |
|
4031 |
seconds_per_step = ((time.time() - current_upscaler_generation_start_time) / int(callback_step_index))
|
4032 |
|
|
|
4065 |
|
4066 |
progress(
|
4067 |
progress = (
|
4068 |
+
callback_step_number,
|
4069 |
current_estimated_total_upscaler_steps
|
4070 |
),
|
4071 |
desc = upscaler_progress_text,
|