Spaces:
Paused
Paused
Update app.py
Browse files47 unmodified lines4849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415555 unmodified lines21121221321421521621721821947 unmodified linespipe.fuse_lora(lora_scale=0.125)pipe.to(device="cuda", dtype=torch.bfloat16)css = """footer {display: none !important}.gradio-container {max-width: 1200px;margin: auto;}.contain {background: rgba(255, 255, 255, 0.05);border-radius: 12px;padding: 20px;}.generate-btn {background: linear-gradient(90deg, #4B79A1 0%, #283E51 100%) !important;border: none !important;color: white !important;}.generate-btn:hover {transform: translateY(-2px);box-shadow: 0 5px 15px rgba(0,0,0,0.2);}.title {text-align: center;font-size: 2.5em;font-weight: bold;margin-bottom: 1em;background: linear-gradient(90deg, #4B79A1 0%, #283E51 100%);-webkit-background-clip: text;-webkit-text-fill-color: transparent;}/* Gallery specific styles */#gallery {width: 100% !important;max-width: 100% !important;overflow: visible !important;}#gallery > div {width: 100% !important;max-width: none !important;}#gallery > div > div {width: 100% !important;display: grid !important;grid-template-columns: repeat(5, 1fr) !important;gap: 16px !important;padding: 16px !important;}.gallery-container {background: rgba(255, 255, 255, 0.05);border-radius: 8px;margin-top: 10px;width: 100% !important;box-sizing: border-box !important;}/* Force gallery items to maintain aspect ratio */.gallery-item {width: 100% !important;aspect-ratio: 1 !important;overflow: hidden !important;border-radius: 4px !important;}.gallery-item img {width: 100% !important;height: 100% !important;object-fit: cover !important;border-radius: 4px !important;transition: transform 0.2s;}.gallery-item img:hover {transform: scale(1.05);}/* Force output image container to full width */.output-image {width: 100% !important;max-width: 100% !important;}/* Force container widths */.contain > div {width: 100% !important;max-width: 100% !important;}.fixed-width {width: 100% !important;max-width: 100% !important;}/* Remove any horizontal scrolling */.gallery-container::-webkit-scrollbar {display: none !important;}.gallery-container {-ms-overflow-style: none !important;scrollbar-width: none !important;}/* Ensure consistent sizing for gallery wrapper */#gallery > div {width: 100% !important;max-width: 100% !important;}#gallery > div > div {width: 100% !important;max-width: 100% !important;}"""def save_image(image):"""Save the generated image and return the path"""try:55 unmodified linesreturn []# Create Gradio interfacewith gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:gr.HTML('<div class="title">AI Image Generator</div>')gr.HTML('<div style="text-align: center; margin-bottom: 2em; color: #666;">Create stunning images from your descriptions</div>')with gr.Row():with gr.Column(scale=3):47 unmodified lines4849505152535455 unmodified lines11011111211311411511647 unmodified linespipe.fuse_lora(lora_scale=0.125)pipe.to(device="cuda", dtype=torch.bfloat16)def save_image(image):"""Save the generated image and return the path"""try:55 unmodified linesreturn []# Create Gradio interfacewith gr.Blocks(theme=gr.themes.Soft()) as demo:with gr.Row():with gr.Column(scale=3):
app.py+2-105