File size: 802 Bytes
2ec2ebd
 
 
 
 
773453a
2ec2ebd
 
 
680fd14
2ec2ebd
 
 
 
 
680fd14
 
12ff912
 
680fd14
12ff912
 
 
ad4c6dc
 
 
 
1745245
ad4c6dc
680fd14
6bd54bd
2ec2ebd
e18f8f6
ad4c6dc
262aa6b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import gradio as gr
import sys
# sys.path.append("LaVi-Bridge/test")
# from llama2_unet_diffusion_lens import call_diffusion_lens
from diffusion_lens import get_images
import gradio as gr
import os
import subprocess



def display_images(images):
    # Prepare images for display
    return [gr.Image(image) for image in images]

def get_prompt(prompt):
    print('prompt:', prompt)
    return prompt



def generate_images(prompt):
    print('calling diffusion lens')
    all_images = []
    for skip_layers in range(2):
        images = get_images(prompt, skip_layers=skip_layers)
        all_images.append(images[0])
    print('after call images')
    return all_images



with gr.Blocks() as demo:
    text_input = gr.Interface(fn=generate_images, inputs="text", outputs=["image"]*2)
demo.launch()