Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #42 from banodoco/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
piyushK52 authored Nov 22, 2023
2 parents 5824ab8 + 8a8441e commit 0d9fca7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
13 changes: 10 additions & 3 deletions ui_components/components/app_settings_page.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import time
import streamlit as st
import webbrowser
from shared.constants import SERVER, ServerType
Expand All @@ -17,6 +18,7 @@ def app_settings_page():
if SERVER != ServerType.DEVELOPMENT.value:
with st.expander("Purchase Credits", expanded=True):
user_credits = get_current_user().total_credits
user_credits = round(user_credits, 2) if user_credits else 0
st.write(f"Total Credits: {user_credits}")
c1, c2 = st.columns([1,1])
with c1:
Expand All @@ -29,6 +31,11 @@ def app_settings_page():
st.rerun()

if st.button("Generate payment link"):
payment_link = data_repo.generate_payment_link(credits)
payment_link = f"""<a target='_self' href='{payment_link}'> PAYMENT LINK </a>"""
st.markdown(payment_link, unsafe_allow_html=True)
if credits < 10:
st.error("Minimum credit value should be atleast 10")
time.sleep(0.7)
st.rerun()
else:
payment_link = data_repo.generate_payment_link(credits)
payment_link = f"""<a target='_self' href='{payment_link}'> PAYMENT LINK </a>"""
st.markdown(payment_link, unsafe_allow_html=True)
4 changes: 2 additions & 2 deletions ui_components/components/frame_styling_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def frame_styling_page(shot_uuid: str):
st.session_state['shot_view'] = st_memory.menu('',\
["Animate Frames", "Basic Cropping"], \
icons=['film', 'crop', "paint-bucket", 'pencil'], \
menu_icon="cast", default_index=st.session_state.get('styling_view_index', 0), \
key="styling_view_selector", orientation="horizontal", \
menu_icon="cast", default_index=st.session_state.get('animation_view_index', 0), \
key="animation_view_selector", orientation="horizontal", \
styles={"nav-link": {"font-size": "15px", "margin": "0px", "--hover-color": "#eee"}, "nav-link-selected": {"background-color": "#66A9BE"}})

if st.session_state['shot_view'] == "Animate Frames":
Expand Down
2 changes: 1 addition & 1 deletion ui_components/widgets/explorer_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def gallery_image_view(project_uuid,page_number=1,num_items_per_page=20, open_de
st.rerun()

if gallery_image_list[i + j].inference_log:
log = data_repo.get_inference_log_from_uuid(gallery_image_list[i + j].inference_log.uuid)
log = gallery_image_list[i + j].inference_log # data_repo.get_inference_log_from_uuid(gallery_image_list[i + j].inference_log.uuid)
if log:
input_params = json.loads(log.input_params)
prompt = input_params.get('prompt', 'No prompt found')
Expand Down
14 changes: 12 additions & 2 deletions ui_components/widgets/inpainting_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,18 @@ def inpainting_element(timing_uuid):
with edit1:
if st.button(f'Run Edit On Current Image'):
if st.session_state["type_of_mask_replacement"] == "Inpainting":
edited_image, log = execute_image_edit(type_of_mask_selection, st.session_state["type_of_mask_replacement"],
"", editing_image, prompt, negative_prompt, width, height, st.session_state['which_layer'], st.session_state['current_frame_uuid'])
edited_image, log = execute_image_edit(
type_of_mask_selection,
st.session_state["type_of_mask_replacement"],
"",
editing_image,
prompt,
negative_prompt,
width,
height,
'Foreground',
st.session_state['current_frame_uuid']
)

inference_data = {
"inference_type": InferenceType.FRAME_INPAINTING.value,
Expand Down

0 comments on commit 0d9fca7

Please sign in to comment.