Skip to content

Commit

Permalink
Merge pull request #62 from banodoco/green-head
Browse files Browse the repository at this point in the history
Green head
  • Loading branch information
peteromallet authored Dec 23, 2023
2 parents dfe8078 + 6589d4f commit 09aea29
Show file tree
Hide file tree
Showing 15 changed files with 407 additions and 373 deletions.
39 changes: 39 additions & 0 deletions ui_components/components/adjust_shot_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import streamlit as st
from ui_components.widgets.shot_view import shot_keyframe_element
from ui_components.components.explorer_page import gallery_image_view
from ui_components.components.explorer_page import generate_images_element
from ui_components.widgets.frame_selector import frame_selector_widget
from utils import st_memory



def adjust_shot_page(shot_uuid: str, h2,data_repo,shot,timing_list, project_settings):
with h2:
frame_selector_widget(show=['shot_selector'])

st.markdown(f"#### :red[{st.session_state['main_view_type']}] > :green[{st.session_state['page']}] > :orange[{shot.name}]")

st.markdown("***")

shot_keyframe_element(st.session_state["shot_uuid"], 4, position="Individual")
# with st.expander("📋 Explorer Shortlist",expanded=True):
shot_explorer_view = st_memory.menu('',["Shortlist", "Explore"],
icons=['grid-3x3','airplane'],
menu_icon="cast",
default_index=st.session_state.get('shot_explorer_view', 0),
key="shot_explorer_view", orientation="horizontal",
styles={"nav-link": {"font-size": "15px", "margin": "0px", "--hover-color": "#eee"}, "nav-link-selected": {"background-color": "#868c91"}})

st.markdown("***")

if shot_explorer_view == "Shortlist":
project_setting = data_repo.get_project_setting(shot.project.uuid)
page_number = st.radio("Select page:", options=range(1, project_setting.total_shortlist_gallery_pages + 1), horizontal=True)
st.markdown("***")
gallery_image_view(shot.project.uuid, page_number=page_number, num_items_per_page=8, open_detailed_view_for_all=False, shortlist=True, num_columns=4,view="individual_shot", shot=shot)
elif shot_explorer_view == "Explore":
project_setting = data_repo.get_project_setting(shot.project.uuid)
page_number = st.radio("Select page:", options=range(1, project_setting.total_shortlist_gallery_pages + 1), horizontal=True)
generate_images_element(position='explorer', project_uuid=shot.project.uuid, timing_uuid=st.session_state['current_frame_uuid'])
st.markdown("***")
gallery_image_view(shot.project.uuid, page_number=page_number, num_items_per_page=8, open_detailed_view_for_all=False, shortlist=False, num_columns=4,view="individual_shot", shot=shot)
14 changes: 14 additions & 0 deletions ui_components/components/animate_shot_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import streamlit as st
from ui_components.widgets.frame_selector import frame_selector_widget
from ui_components.widgets.variant_comparison_grid import variant_comparison_grid
from ui_components.widgets.animation_style_element import animation_style_element

def animate_shot_page(shot_uuid: str,h2,data_repo,shot,timing_list, project_settings):

with h2:
frame_selector_widget(show=['shot_selector'])
st.markdown(f"#### :red[{st.session_state['main_view_type']}] > :green[{st.session_state['page']}] > :orange[{shot.name}]")
st.markdown("***")
variant_comparison_grid(st.session_state['shot_uuid'], stage="Shots")
with st.expander("🎬 Choose Animation Style & Create Variants", expanded=True):
animation_style_element(st.session_state['shot_uuid'])
Original file line number Diff line number Diff line change
Expand Up @@ -24,53 +24,45 @@ class InputImageStyling(ExtendedEnum):
MAINTAIN_STRUCTURE = "Maintain Structure"


def columnn_selecter():
f1, f2 = st.columns([1, 1])
with f1:
st_memory.slider('Number of columns:', min_value=3, max_value=7, value=4,key="num_columns_explorer")
with f2:
st_memory.slider('Items per page:', min_value=10, max_value=50, value=16, key="num_items_per_page_explorer")

def explorer_element(project_uuid):

st.markdown("***")

def explorer_page(project_uuid):

data_repo = DataRepo()

project_setting = data_repo.get_project_setting(project_uuid)

project_setting = data_repo.get_project_setting(project_uuid)


f1, f2 = st.columns([1, 1])
with f1:
num_columns = st_memory.slider('Number of columns:', min_value=3, max_value=7, value=4,key="num_columns_explorer")
with f2:
num_items_per_page = st_memory.slider('Items per page:', min_value=10, max_value=50, value=16, key="num_items_per_page_explorer")
st.markdown(f"#### :red[{st.session_state['main_view_type']}] > :green[{st.session_state['page']}]")
st.markdown("***")
z1, z2, z3 = st.columns([0.25,2,0.25])
with z2:
with st.expander("Prompt Settings", expanded=True):
generate_images_element(position='explorer', project_uuid=project_uuid, timing_uuid=None)
st.markdown("***")
columnn_selecter()
k1,k2 = st.columns([5,1])
page_number = k1.radio("Select page:", options=range(1, project_setting.total_gallery_pages + 1), horizontal=True, key="main_gallery")
open_detailed_view_for_all = k2.toggle("Open detailed view for all:", key='main_gallery_toggle')
st.markdown("***")
gallery_image_view(project_uuid, page_number, st.session_state['num_items_per_page_explorer'], open_detailed_view_for_all, False, st.session_state['num_columns_explorer'],view="explorer")

with st.sidebar:

st.session_state['explorer_view'] = st_memory.menu(
'',
["Explorations", "Shortlist"],
icons=['airplane', 'grid-3x3', "paint-bucket", 'pencil'],
menu_icon="cast",
default_index=0,
key="explorer_view_selector",
orientation="horizontal",
styles={"nav-link": {"font-size": "15px", "margin": "0px", "--hover-color": "#eee"}, "nav-link-selected": {"background-color": "#0068c9"}},
)
# tab1, tab2 = st.tabs(["Explorations", "Shortlist"])
if st.session_state['explorer_view'] == "Explorations":
z1, z2, z3 = st.columns([0.25,2,0.25])
with z2:
with st.expander("Prompt Settings", expanded=True):
generate_images_element(position='explorer', project_uuid=project_uuid, timing_uuid=None)

k1,k2 = st.columns([5,1])
page_number = k1.radio("Select page:", options=range(1, project_setting.total_gallery_pages + 1), horizontal=True, key="main_gallery")
open_detailed_view_for_all = k2.toggle("Open detailed view for all:", key='main_gallery_toggle')
gallery_image_view(project_uuid, page_number, num_items_per_page, open_detailed_view_for_all, False, num_columns,view="explorer")
elif st.session_state['explorer_view'] == "Shortlist":
k1,k2 = st.columns([5,1])
shortlist_page_number = k1.radio("Select page", options=range(1, project_setting.total_shortlist_gallery_pages), horizontal=True, key="shortlist_gallery")
with k2:
open_detailed_view_for_all = st_memory.toggle("Open prompt details for all:", key='shortlist_gallery_toggle')
gallery_image_view(project_uuid, shortlist_page_number, num_items_per_page, open_detailed_view_for_all, True, num_columns,view="shortlist")

def shortlist_element(project_uuid):
data_repo = DataRepo()
project_setting = data_repo.get_project_setting(project_uuid)
columnn_selecter()
k1,k2 = st.columns([5,1])
shortlist_page_number = k1.radio("Select page", options=range(1, project_setting.total_shortlist_gallery_pages), horizontal=True, key="shortlist_gallery")
with k2:
open_detailed_view_for_all = st_memory.toggle("Open prompt details for all:", key='shortlist_gallery_toggle')
st.markdown("***")
gallery_image_view(project_uuid, shortlist_page_number, st.session_state['num_items_per_page_explorer'], open_detailed_view_for_all, True, st.session_state['num_columns_explorer'],view="shortlist")



def generate_images_element(position='explorer', project_uuid=None, timing_uuid=None):
Expand Down
Loading

0 comments on commit 09aea29

Please sign in to comment.