File size: 1,955 Bytes
f205d49
 
 
22cda6d
f205d49
 
 
 
22cda6d
f01b4da
85e031f
f01b4da
 
 
85e031f
614dfc6
95ac94c
37da40b
95ac94c
 
37da40b
95ac94c
 
 
8ba3b5a
95ac94c
8ba3b5a
 
85e031f
 
 
 
 
 
 
 
f01b4da
 
 
 
 
 
 
 
fe28f2e
f01b4da
f205d49
f01b4da
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
37
38
39
40
41
42
43
44
45
46
47
48
49
import gradio as gr
from inference_code import generate_images


def generate_image_predictions(prompt):
    images = generate_images(prompt)
    return images


demo = gr.Blocks()

with demo:
    gr.Markdown(
        """
        # 🌍 Map Diffuser

        🌏 Generates images from a given text prompt. The prompts are in the format:
        `{style} map of {city} with {features}` or
        `satellite image of {city} with {features}` or
        `satellite image with {features}` or
        `satellite image of {city} with {features} and no {features}`
        and so on...

        So for example:
        - "Satellite image of amsterdam with industrial area and highways"
        - "Watercolor style map of Amsterdam with residential area and highways"
        - "Toner style map of Amsterdam with residential area and highways"
        - "Satellite image with forests and residential, no water"

        Examples table:
        | Prompt | Output |
        | --- | --- |
        | Satellite image of amsterdam with industrial area and highways | <img src="https://i.imgur.com/vrGpk45.png" width="300" /> |
        | Watercolor style map of Amsterdam with residential area and highways | <img src="https://i.imgur.com/AQS34dk.png" width="300" /> |
        | Toner style map of Amsterdam with residential area and highways | <img src="https://i.imgur.com/X8VcezT.png" width="300" /> |
        | Satellite image with forests and residential, no water | <img src="https://i.imgur.com/MEccHdM.png" width="300" /> |
    """
    )
    input = gr.components.Textbox(label="Enter a text prompt here")
    output = gr.components.Image(label="Output Image")
    # button to submit the prompt
    button = gr.components.Button(label="Generate")
    # when the button is clicked, call the generate_image_predictions function
    # and pass in the prompt as an argument
    button.click(generate_image_predictions, inputs=input, outputs=output)


demo.launch()