Skip to content

ui apis for dalle-mini#1258

Merged
abidlabs merged 2 commits into
mainfrom
ui-api
May 14, 2022
Merged

ui apis for dalle-mini#1258
abidlabs merged 2 commits into
mainfrom
ui-api

Conversation

@pngwn
Copy link
Copy Markdown
Member

@pngwn pngwn commented May 13, 2022

Popped this up for everyone to take a look. Feeel free to propose alternative solutions, names, etc.

This was the demo i was able to create with the addition of these APIs.

Screenshot 2022-05-13 at 23 54 30

The code looks like this:

with gr.Blocks(css=".container { max-width: 800px; margin: auto; }") as demo:
    gr.Markdown("<h1><center>DALL·E mini</center></h1>")
    gr.Markdown(
        "DALL·E mini is an AI model that generates images from any prompt you give!"
    )
    with gr.Group():
        with gr.Box():
            with gr.Row().style(mobile_collapse=False, equal_height=True):
                text = gr.Textbox(
                    label="Enter your prompt", show_label=False, max_lines=1
                ).style(
                    border=(True, False, True, True),
                    margin=False,
                    rounded=(True, False, False, True),
                    container=False,
                )
                btn = gr.Button("Run").style(
                    margin=False,
                    rounded=(False, True, True, False),
                )
        gallery = gr.Gallery(label="Generated images", show_label=False).style(
            grid=(1, 3),
            height="auto",
        )
    btn.click(img, inputs=text, outputs=gallery)

Comment thread ui/packages/app/tailwind.config.js
Comment thread ui/packages/atoms/src/Block.svelte Outdated
Comment thread ui/packages/atoms/src/Block.svelte Outdated
Comment thread gradio/components.py Outdated
Copy link
Copy Markdown
Contributor

@aliabid94 aliabid94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestions, otherwise looks great!

@abidlabs
Copy link
Copy Markdown
Member

Love it!

@abidlabs
Copy link
Copy Markdown
Member

Will merge it in so that I can start working on all of the merge conflicts that are bound to happen soon

@abidlabs abidlabs merged commit 97929ee into main May 14, 2022
@abidlabs abidlabs deleted the ui-api branch May 14, 2022 01:37
@abidlabs abidlabs mentioned this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants