Spaces:
Runtime error
Runtime error
Upload 8 files
Browse filesFiles changed (8)
2 unmodified lines345678910111213141523 unmodified lines39404142434445144 unmodified lines19019119219319419519639 unmodified lines23623723823924024124224324424524624724824926 unmodified lines27627727827928028128228332 unmodified lines31631731831932032132232332 unmodified lines35635735835936036136236332 unmodified lines39639739839940040140240332 unmodified lines43643743843944044144244372 unmodified lines5165175185195205215225235246 unmodified lines5315325335345355365376 unmodified lines5445455465475485495506 unmodified lines5575585595605615625636 unmodified lines5705715725735745755766 unmodified lines5835845855865875885896 unmodified lines5965975985996006016022 unmodified linesfrom utils.text2image import stable_diffusion_text2imgfrom utils.inpaint import stable_diffusion_inpaintfrom controlnet.controlnet_canny import stable_diffusion_controlnet_img2imgfrom controlnet.controlnet_depth import stable_diffusion_controlnet_img2imgfrom controlnet.controlnet_hed import stable_diffusion_controlnet_img2imgfrom controlnet.controlnet_mlsd import stable_diffusion_controlnet_img2imgfrom controlnet.controlnet_pose import stable_diffusion_controlnet_img2imgfrom controlnet.controlnet_scribble import stable_diffusion_controlnet_img2imgfrom controlnet.controlnet_seg import stable_diffusion_controlnet_img2imgimport gradio as gr23 unmodified lines]app = gr.Blocks()with app:gr.Markdown("# **<h2 align='center'>Stable Diffusion + ControlNet WebUI<h2>**")gr.Markdown("""<h5 style='text-align: center'>144 unmodified linesinpaint_predict = gr.Button(value='Generator')with gr.Tab('ControlNet'):with gr.Tab('Canny'):controlnet_canny_image_file = gr.Image(label='Image')39 unmodified linescontrolnet_hed_image_file = gr.Image(label='Image')controlnet_hed_model_id = gr.Dropdown(choices=stable_prompt_list,value=stable_prompt_list[0],label='Stable Model Id')controlnet_hed_prompt = gr.Textbox(lines=1,value=stable_prompt_list[0],label='Prompt')26 unmodified linescontrolnet_mlsd_image_file = gr.Image(label='Image')controlnet_mlsd_model_id = gr.Dropdown(choices=stable_prompt_list,value=stable_prompt_list[0],label='Stable Model Id')32 unmodified linescontrolnet_seg_image_file = gr.Image(label='Image')controlnet_seg_model_id = gr.Dropdown(choices=stable_prompt_list,value=stable_prompt_list[0],label='Stable Model Id')32 unmodified linescontrolnet_depth_image_file = gr.Image(label='Image')controlnet_depth_model_id = gr.Dropdown(choices=stable_prompt_list,value=stable_prompt_list[0],label='Stable Model Id')32 unmodified linescontrolnet_scribble_image_file = gr.Image(label='Image')controlnet_scribble_model_id = gr.Dropdown(choices=stable_prompt_list,value=stable_prompt_list[0],label='Stable Model Id')32 unmodified linescontrolnet_pose_image_file = gr.Image(label='Image')controlnet_pose_model_id = gr.Dropdown(choices=stable_prompt_list,value=stable_prompt_list[0],label='Stable Model Id')72 unmodified linesoutputs = [output_image],)controlnet_canny_predict.click(fn = stable_diffusion_controlnet_img2img,inputs = [controlnet_canny_image_file,controlnet_canny_model_id,6 unmodified lines)controlnet_hed_predict.click(fn = stable_diffusion_controlnet_img2img,inputs = [controlnet_hed_image_file,controlnet_hed_model_id,6 unmodified lines)controlnet_mlsd_predict.click(fn = stable_diffusion_controlnet_img2img,inputs = [controlnet_mlsd_image_file,controlnet_mlsd_model_id,6 unmodified lines)controlnet_seg_predict.click(fn = stable_diffusion_controlnet_img2img,inputs = [controlnet_seg_image_file,controlnet_seg_model_id,6 unmodified lines)controlnet_depth_predict.click(fn = stable_diffusion_controlnet_img2img,inputs = [controlnet_depth_image_file,controlnet_depth_model_id,6 unmodified lines)controlnet_scribble_predict.click(fn = stable_diffusion_controlnet_img2img,inputs = [controlnet_scribble_image_file,controlnet_scribble_model_id,6 unmodified lines)controlnet_pose_predict.click(fn = stable_diffusion_controlnet_img2img,inputs = [controlnet_pose_image_file,controlnet_pose_model_id,2 unmodified lines345678910111213141523 unmodified lines39404142434445144 unmodified lines19019119219319419539 unmodified lines23523623723823924024124224324424524624724826 unmodified lines27527627727827928028128232 unmodified lines31531631731831932032132232 unmodified lines35535635735835936036136232 unmodified lines39539639739839940040140232 unmodified lines43543643743843944044144272 unmodified lines5155165175185195205215226 unmodified lines5295305315325335345356 unmodified lines5425435445455465475486 unmodified lines5555565575585595605616 unmodified lines5685695705715725735746 unmodified lines5815825835845855865876 unmodified lines5945955965975985996002 unmodified linesfrom utils.text2image import stable_diffusion_text2imgfrom utils.inpaint import stable_diffusion_inpaintfrom controlnet.controlnet_canny import stable_diffusion_controlnet_cannyfrom controlnet.controlnet_depth import stable_diffusion_controlnet_depthfrom controlnet.controlnet_hed import stable_diffusion_controlnet_hedfrom controlnet.controlnet_mlsd import stable_diffusion_controlnet_mlsdfrom controlnet.controlnet_pose import stable_diffusion_controlnet_posefrom controlnet.controlnet_scribble import stable_diffusion_controlnet_scribblefrom controlnet.controlnet_seg import stable_diffusion_controlnet_segimport gradio as gr23 unmodified lines]app = gr.Blocks()with app:gr.Markdown("# **<h2 align='center'>Stable Diffusion WebUI<h2>**")gr.Markdown("""<h5 style='text-align: center'>144 unmodified linesinpaint_predict = gr.Button(value='Generator')with gr.Tab('ControlNet'):with gr.Tab('Canny'):controlnet_canny_image_file = gr.Image(label='Image')39 unmodified linescontrolnet_hed_image_file = gr.Image(label='Image')controlnet_hed_model_id = gr.Dropdown(choices=stable_model_list,value=stable_model_list[0],label='Stable Model Id')controlnet_hed_prompt = gr.Textbox(lines=1,value=stable_model_list[0],label='Prompt')26 unmodified linescontrolnet_mlsd_image_file = gr.Image(label='Image')controlnet_mlsd_model_id = gr.Dropdown(choices=stable_model_list,value=stable_model_list[0],label='Stable Model Id')32 unmodified linescontrolnet_seg_image_file = gr.Image(label='Image')controlnet_seg_model_id = gr.Dropdown(choices=stable_model_list,value=stable_model_list[0],label='Stable Model Id')32 unmodified linescontrolnet_depth_image_file = gr.Image(label='Image')controlnet_depth_model_id = gr.Dropdown(choices=stable_model_list,value=stable_model_list[0],label='Stable Model Id')32 unmodified linescontrolnet_scribble_image_file = gr.Image(label='Image')controlnet_scribble_model_id = gr.Dropdown(choices=stable_model_list,value=stable_model_list[0],label='Stable Model Id')32 unmodified linescontrolnet_pose_image_file = gr.Image(label='Image')controlnet_pose_model_id = gr.Dropdown(choices=stable_model_list,value=stable_model_list[0],label='Stable Model Id')72 unmodified linesoutputs = [output_image],)controlnet_canny_predict.click(fn = stable_diffusion_controlnet_canny,inputs = [controlnet_canny_image_file,controlnet_canny_model_id,6 unmodified lines)controlnet_hed_predict.click(fn = stable_diffusion_controlnet_hed,inputs = [controlnet_hed_image_file,controlnet_hed_model_id,6 unmodified lines)controlnet_mlsd_predict.click(fn = stable_diffusion_controlnet_mlsd,inputs = [controlnet_mlsd_image_file,controlnet_mlsd_model_id,6 unmodified lines)controlnet_seg_predict.click(fn = stable_diffusion_controlnet_seg,inputs = [controlnet_seg_image_file,controlnet_seg_model_id,6 unmodified lines)controlnet_depth_predict.click(fn = stable_diffusion_controlnet_depth,inputs = [controlnet_depth_image_file,controlnet_depth_model_id,6 unmodified lines)controlnet_scribble_predict.click(fn = stable_diffusion_controlnet_scribble,inputs = [controlnet_scribble_image_file,controlnet_scribble_model_id,6 unmodified lines)controlnet_pose_predict.click(fn = stable_diffusion_controlnet_pose,inputs = [controlnet_pose_image_file,controlnet_pose_model_id,
26 unmodified lines2728293031323326 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_img2img(stable_model_path:str,image_path:str,prompt:str,26 unmodified lines2728293031323326 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_canny(stable_model_path:str,image_path:str,prompt:str,
23 unmodified lines2425262728293023 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_img2img(stable_model_path:str,image_path:str,prompt:str,23 unmodified lines2425262728293023 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_depth(stable_model_path:str,image_path:str,prompt:str,
1234567891011129 unmodified lines22232425262728from diffusers import ( StableDiffusionControlNetPipeline,ControlNetModel, UniPCMultistepScheduler,DDIMScheduler)from controlnet_aux import HEDdetectorfrom PIL import Imageimport numpy as npimport torchimport cv2def controlnet_hed(image_path:str):9 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_img2img(stable_model_path:str,image_path:str,prompt:str,1234567899 unmodified lines19202122232425from diffusers import ( StableDiffusionControlNetPipeline,ControlNetModel, UniPCMultistepScheduler)from controlnet_aux import HEDdetectorfrom PIL import Imageimport torchdef controlnet_hed(image_path:str):9 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_hed(stable_model_path:str,image_path:str,prompt:str,
1234567891011129 unmodified lines22232425262728from diffusers import ( StableDiffusionControlNetPipeline,ControlNetModel, UniPCMultistepScheduler,DDIMScheduler)from controlnet_aux import MLSDdetectorfrom PIL import Imageimport numpy as npimport torchimport cv2def controlnet_mlsd(image_path:str):9 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_img2img(stable_model_path:str,image_path:str,prompt:str,1234567899 unmodified lines19202122232425from diffusers import ( StableDiffusionControlNetPipeline,ControlNetModel, UniPCMultistepScheduler)from controlnet_aux import MLSDdetectorfrom PIL import Imageimport torchdef controlnet_mlsd(image_path:str):9 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_mlsd(stable_model_path:str,image_path:str,prompt:str,
19 unmodified lines2021222324252619 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_img2img(stable_model_path:str,image_path:str,prompt:str,19 unmodified lines2021222324252619 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_pose(stable_model_path:str,image_path:str,prompt:str,
12345613 unmodified lines20212223242526from diffusers import ( StableDiffusionControlNetPipeline,ControlNetModel, UniPCMultistepScheduler,DDIMScheduler)from controlnet_aux import HEDdetector13 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_img2img(stable_model_path:str,image_path:str,prompt:str,1234513 unmodified lines19202122232425from diffusers import ( StableDiffusionControlNetPipeline,ControlNetModel, UniPCMultistepScheduler)from controlnet_aux import HEDdetector13 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_scribble(stable_model_path:str,image_path:str,prompt:str,
77 unmodified lines7879808182838477 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_img2img(stable_model_path:str,image_path:str,prompt:str,77 unmodified lines7879808182838477 unmodified linesreturn controlnet, imagedef stable_diffusion_controlnet_seg(stable_model_path:str,image_path:str,prompt:str,
app.py+28-30
controlnet/controlnet_canny.py+1-1
controlnet/controlnet_depth.py+1-1
controlnet/controlnet_hed.py+2-5
controlnet/controlnet_mlsd.py+2-5
controlnet/controlnet_pose.py+1-1
controlnet/controlnet_scribble.py+2-3
controlnet/controlnet_seg.py+1-1