Spaces:
Runtime error
Runtime error
File size: 2,161 Bytes
dc85175 09c2c65 dc85175 09c2c65 dc85175 09c2c65 dc85175 09c2c65 dc85175 09c2c65 dc85175 |
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 50 |
import streamlit as st
import gradio as gr
import IPython
import streamlit as st
import streamlit.components.v1 as components
from IPython.display import IFrame
src='' # URL parameter to change the iframe url
def SetIframeURL(option_selected):
if (option_selected=='Collager'):
src='https://www.artbreeder.com/beta/collage'
if (option_selected=='Midjourney'):
src='https://www.midjourney.com/app/users/779773261440614430/'
if (option_selected=='DreamStudio'):
src='https://beta.dreamstudio.ai/dream'
if (option_selected=='NightCafe'):
src='https://creator.nightcafe.studio/explore'
if (option_selected=='RunwayML'):
src='https://app.runwayml.com/'
width = st.sidebar.slider("Width", 200, 1500, 800, 100)
height = st.sidebar.slider("Height", 200, 1500, 900, 100)
st.components.v1.iframe(src, width, height, scrolling=True)
try:
options = ['Collager', 'Midjourney', 'DreamStudio', 'NightCafe', 'RunwayML']
query_params = st.experimental_get_query_params()
query_option = query_params['option'][0] #throws an exception when visiting http://host:port
option_selected = st.sidebar.selectbox('Pick option', options, index=options.index(query_option))
if option_selected:
st.experimental_set_query_params(option=option_selected)
SetIframeURL(option_selected)
except:
options = ['Collager', 'Midjourney', 'DreamStudio', 'NightCafe', 'RunwayML']
st.experimental_set_query_params(option=options[1]) # defaults to dog
query_params = st.experimental_get_query_params()
query_option = query_params['option'][0]
option_selected = st.sidebar.selectbox('Pick option', options, index=options.index(query_option))
if option_selected:
st.experimental_set_query_params(option=option_selected)
SetIframeURL(option_selected)
def LoadGradioAIModels():
title = "Image Generation for Art, Marketing, Ideation, Design, and Use in Business"
description = "Image Generation for Art, Marketing, Ideation, Design, and Use in Business"
article = "<p style='text-align: center'></p>"
examples = [[""]]
|