Spaces:
Runtime error
Runtime error
Update app.py
Browse files44 unmodified lines454647484950512 unmodified lines54555657585960616263646566676869707132 unmodified lines10410510610710810911011111211311411544 unmodified lines# Initialize the image processorbase_path = "black-forest-labs/FLUX.1-dev"lora_base_path = "EasyControl/models"style_lora_base_path = "Shakker-Labs"processor = ImageProcessor(base_path)2 unmodified lines# Set the control typeif control_type == "subject":lora_path = os.path.join(lora_base_path, "subject.safetensors")elif control_type == "depth":lora_path = os.path.join(lora_base_path, "depth.safetensors")elif control_type == "seg":lora_path = os.path.join(lora_base_path, "seg.safetensors")elif control_type == "pose":lora_path = os.path.join(lora_base_path, "pose.safetensors")elif control_type == "inpainting":lora_path = os.path.join(lora_base_path, "inpainting.safetensors")elif control_type == "hedsketch":lora_path = os.path.join(lora_base_path, "hedsketch.safetensors")elif control_type == "canny":lora_path = os.path.join(lora_base_path, "canny.safetensors")set_single_lora(processor.pipe.transformer, lora_path, lora_weights=[1], cond_size=512)# Set the style LoRA32 unmodified linesreturn image# Define the Gradio interface componentscontrol_types = ["subject", "depth", "pose", "inpainting", "hedsketch", "seg", "canny"]style_loras = ["Simple_Sketch", "Text_Poster", "Vector_Style", "None"]# Example datasingle_examples = [["A SKS in the library", Image.open("./test_imgs/subject1.png"), None, 1024, 1024, 5, "subject", None],["In a picturesque village, a narrow cobblestone street with rustic stone buildings, colorful blinds, and lush green spaces, a cartoon man drawn with simple lines and solid colors stands in the foreground, wearing a red shirt, beige work pants, and brown shoes, carrying a strap on his shoulder. The scene features warm and enticing colors, a pleasant fusion of nature and architecture, and the camera's perspective on the street clearly shows the charming and quaint environment., Integrating elements of reality and cartoon.", None, Image.open("./test_imgs/spatial1.png"), 1024, 1024, 1, "pose", "Vector_Style"],]multi_examples = [44 unmodified lines454647484950512 unmodified lines5455565758596061626332 unmodified lines9697989910010110210310410510610744 unmodified lines# Initialize the image processorbase_path = "black-forest-labs/FLUX.1-dev"lora_base_path = "./models"style_lora_base_path = "Shakker-Labs"processor = ImageProcessor(base_path)2 unmodified lines# Set the control typeif control_type == "subject":lora_path = os.path.join(lora_base_path, "subject.safetensors")elif control_type == "pose":lora_path = os.path.join(lora_base_path, "pose.safetensors")elif control_type == "inpainting":lora_path = os.path.join(lora_base_path, "inpainting.safetensors")set_single_lora(processor.pipe.transformer, lora_path, lora_weights=[1], cond_size=512)# Set the style LoRA32 unmodified linesreturn image# Define the Gradio interface componentscontrol_types = ["subject", "pose", "inpainting"]style_loras = ["Simple_Sketch", "Text_Poster", "Vector_Style", "None"]# Example datasingle_examples = [["A SKS in the library", Image.open("./test_imgs/subject1.png"), None, 1024, 1024, 5, "subject", "None"],["In a picturesque village, a narrow cobblestone street with rustic stone buildings, colorful blinds, and lush green spaces, a cartoon man drawn with simple lines and solid colors stands in the foreground, wearing a red shirt, beige work pants, and brown shoes, carrying a strap on his shoulder. The scene features warm and enticing colors, a pleasant fusion of nature and architecture, and the camera's perspective on the street clearly shows the charming and quaint environment., Integrating elements of reality and cartoon.", None, Image.open("./test_imgs/spatial1.png"), 1024, 1024, 1, "pose", "Vector_Style"],]multi_examples = [
app.py+3-11