Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -418,7 +418,7 @@ def generate_30(
|
|
418 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
419 |
filename= f'rv_IP_{timestamp}.png'
|
420 |
print("-- using image file --")
|
421 |
-
captions = caption
|
422 |
captions = flatten_and_stringify(captions)
|
423 |
captions = " ".join(captions)
|
424 |
print(captions)
|
@@ -568,7 +568,7 @@ def generate_60(
|
|
568 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
569 |
filename= f'rv_IP_{timestamp}.png'
|
570 |
print("-- using image file --")
|
571 |
-
captions = caption
|
572 |
captions = flatten_and_stringify(captions)
|
573 |
captions = " ".join(captions)
|
574 |
print(captions)
|
@@ -672,9 +672,12 @@ def generate_90(
|
|
672 |
caption=[]
|
673 |
caption_2=[]
|
674 |
#caption.append(captioner(sd_image_a))
|
675 |
-
|
|
|
676 |
#caption.append(captioner_3(sd_image_a))
|
677 |
caption_2.append(captioning(sd_image_a))
|
|
|
|
|
678 |
if latent_file_2 is not None: # Check if a latent file is provided
|
679 |
sd_image_b = Image.open(latent_file_2.name).convert('RGB')
|
680 |
#sd_image_b.resize((height,width), Image.LANCZOS)
|
@@ -718,7 +721,7 @@ def generate_90(
|
|
718 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
719 |
filename= f'rv_IP_{timestamp}.png'
|
720 |
print("-- using image file --")
|
721 |
-
captions = caption
|
722 |
captions = flatten_and_stringify(captions)
|
723 |
captions = " ".join(captions)
|
724 |
print(captions)
|
@@ -844,6 +847,7 @@ with gr.Blocks(theme=gr.themes.Origin(),css=css) as demo:
|
|
844 |
)
|
845 |
with gr.Row():
|
846 |
latent_file = gr.File(label="Image Prompt (Required)")
|
|
|
847 |
file_1_strength = gr.Slider(
|
848 |
label="Img 1 %",
|
849 |
minimum=0.0,
|
|
|
418 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
419 |
filename= f'rv_IP_{timestamp}.png'
|
420 |
print("-- using image file --")
|
421 |
+
captions = caption #+caption_2
|
422 |
captions = flatten_and_stringify(captions)
|
423 |
captions = " ".join(captions)
|
424 |
print(captions)
|
|
|
568 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
569 |
filename= f'rv_IP_{timestamp}.png'
|
570 |
print("-- using image file --")
|
571 |
+
captions = caption #+caption_2
|
572 |
captions = flatten_and_stringify(captions)
|
573 |
captions = " ".join(captions)
|
574 |
print(captions)
|
|
|
672 |
caption=[]
|
673 |
caption_2=[]
|
674 |
#caption.append(captioner(sd_image_a))
|
675 |
+
cap=captioner2(sd_image_a)
|
676 |
+
caption.append(cap)
|
677 |
#caption.append(captioner_3(sd_image_a))
|
678 |
caption_2.append(captioning(sd_image_a))
|
679 |
+
global image_1_text
|
680 |
+
image_1_text=cap
|
681 |
if latent_file_2 is not None: # Check if a latent file is provided
|
682 |
sd_image_b = Image.open(latent_file_2.name).convert('RGB')
|
683 |
#sd_image_b.resize((height,width), Image.LANCZOS)
|
|
|
721 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
722 |
filename= f'rv_IP_{timestamp}.png'
|
723 |
print("-- using image file --")
|
724 |
+
captions = caption #+caption_2
|
725 |
captions = flatten_and_stringify(captions)
|
726 |
captions = " ".join(captions)
|
727 |
print(captions)
|
|
|
847 |
)
|
848 |
with gr.Row():
|
849 |
latent_file = gr.File(label="Image Prompt (Required)")
|
850 |
+
image_1_text = gr.Textbox(label="Image 1 Text", lines=5) # Add this line
|
851 |
file_1_strength = gr.Slider(
|
852 |
label="Img 1 %",
|
853 |
minimum=0.0,
|