Commit 4e449853 authored by chenpangpang's avatar chenpangpang
Browse files

feat: gradio指定ip和创建外部链接

parent 32f3222a
...@@ -31,15 +31,11 @@ upscale_model = utils.load_sd_upscale("model_real_esran/RealESRGAN_x4.pth", devi ...@@ -31,15 +31,11 @@ upscale_model = utils.load_sd_upscale("model_real_esran/RealESRGAN_x4.pth", devi
frame_interpolation_model = load_rife_model("model_rife") frame_interpolation_model = load_rife_model("model_rife")
sys_prompt = """You are part of a team of bots that creates videos. You work with an assistant bot that will draw anything you say in square brackets. sys_prompt = """You are part of a team of bots that creates videos. You work with an assistant bot that will draw anything you say in square brackets.
For example , outputting " a beautiful morning in the woods with the sun peaking through the trees " will trigger your partner bot to output an video of a forest morning , as described. You will be prompted by people looking to create detailed , amazing videos. The way to accomplish this is to take their short prompts and make them extremely detailed and descriptive. For example , outputting " a beautiful morning in the woods with the sun peaking through the trees " will trigger your partner bot to output an video of a forest morning , as described. You will be prompted by people looking to create detailed , amazing videos. The way to accomplish this is to take their short prompts and make them extremely detailed and descriptive.
There are a few rules to follow: There are a few rules to follow:
You will only ever output a single video description per user request. You will only ever output a single video description per user request.
When modifications are requested , you should not simply make the description longer . You should refactor the entire description to integrate the suggestions. When modifications are requested , you should not simply make the description longer . You should refactor the entire description to integrate the suggestions.
Other times the user will not want modifications , but instead want a new image . In this case , you should ignore your previous conversation with the user. Other times the user will not want modifications , but instead want a new image . In this case , you should ignore your previous conversation with the user.
Video descriptions must have the same num of words as examples below. Extra words will be ignored. Video descriptions must have the same num of words as examples below. Extra words will be ignored.
""" """
...@@ -154,10 +150,16 @@ with gr.Blocks() as demo: ...@@ -154,10 +150,16 @@ with gr.Blocks() as demo:
<a href="https://github.com/THUDM/CogVideo">🌐 Github</a> | <a href="https://github.com/THUDM/CogVideo">🌐 Github</a> |
<a href="https://arxiv.org/pdf/2408.06072">📜 arxiv </a> <a href="https://arxiv.org/pdf/2408.06072">📜 arxiv </a>
</div> </div>
<div style="text-align: center;display: flex;justify-content: center;align-items: center;margin-top: 1em;margin-bottom: .5em;">
<span>If the Space is too busy, duplicate it to use privately</span>
<a href="https://huggingface.co/spaces/THUDM/CogVideoX-5B-Space?duplicate=true"><img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-lg.svg" width="160" style="
margin-left: .75em;
"></a>
</div>
<div style="text-align: center; font-size: 15px; font-weight: bold; color: red; margin-bottom: 20px;"> <div style="text-align: center; font-size: 15px; font-weight: bold; color: red; margin-bottom: 20px;">
⚠️ This demo is for academic research and experiential use only. ⚠️ This demo is for academic research and experiential use only.
</div> </div>
""") """)
with gr.Row(): with gr.Row():
with gr.Column(): with gr.Column():
...@@ -258,7 +260,7 @@ with gr.Blocks() as demo: ...@@ -258,7 +260,7 @@ with gr.Blocks() as demo:
def generate(prompt, def generate(prompt,
seed_value, seed_value,
scale_status, scale_status,
rife_status, rife_status,
progress=gr.Progress(track_tqdm=True) progress=gr.Progress(track_tqdm=True)
): ):
...@@ -306,4 +308,5 @@ with gr.Blocks() as demo: ...@@ -306,4 +308,5 @@ with gr.Blocks() as demo:
enhance_button.click(enhance_prompt_func, inputs=[prompt], outputs=[prompt]) enhance_button.click(enhance_prompt_func, inputs=[prompt], outputs=[prompt])
if __name__ == "__main__": if __name__ == "__main__":
demo.launch() demo.queue(max_size=15)
demo.launch(server_name='0.0.0.0', share=True)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment