城关区建设局网站普通网站和门户网站的区别

张小明 2026/1/13 10:53:47
城关区建设局网站,普通网站和门户网站的区别,dw网页制作成品12页,如何建自己的个人网站Windows 下 Z-Image-Turbo 专业版 Gradio 生成器实战#xff1a;功能增强全记录 发布时间#xff1a;2025年12月28日 基础功能版#xff1a; Windows 环境下为 Z-Image-Turbo 加装 Gradio 图形生成器 经过一段时间的反复调试和优化#xff0c;我终于在 Windows 11 RTX 30…Windows 下 Z-Image-Turbo 专业版 Gradio 生成器实战功能增强全记录发布时间2025年12月28日基础功能版Windows 环境下为 Z-Image-Turbo 加装 Gradio 图形生成器经过一段时间的反复调试和优化我终于在Windows 11 RTX 3090环境下打造出了一个功能完整、稳定高效、界面美观的 Z-Image-Turbo 专业生成器。这不仅仅是一个简单的推理脚本而是一个本地 AI 画图工作室拥有以下强大功能本地编译 Flash Attention 2.8.3 加速7 秒出图Windows 下成功编译 Flash Attention 2.8.3 flash-attn /flash_attn个人复盘记录Windows 11 下 Z-Image-Turbo 完整部署与 Flash Attention 2.8.3 本地编译复盘Flash Attention 2.6.3 在 Windows 上编译成功复盘笔记批量生成队列Real-ESRGAN 4x 超分放大自动序号文件名永不覆盖生成历史画廊最新 50 张尺寸自动校正16 倍数一键示例 公共分享链接下面分享完整界面、功能演示和使用心得。界面概览主界面单图生成页单图生成页可用示例尝试批量生成页支持多行提示词一次生成多张批量生成页支持多行提示词一次生成多张图片放大页4x Real-ESRGAN 超分GPU 加速图片放大页4x Real-ESRGAN 超分GPU 加速生成历史页最近 50 张记录支持点击上传放大生成历史页最近 50 张记录支持点击上传放大核心功能演示1. 单图生成 自动序号保存输入提示词 可选前缀如 cat_生成后自动保存为 cat_001.png、cat_002.png... 永不覆盖历史画廊实时记录2. 批量生成每行一个提示词一次生成多张支持统一前缀如 beauty_ → beauty_001.png...进度实时显示3. 4x 超分放大从历史画廊点击图片或手动上传一键 4x 放大到 4096×4096 超清大图毛发、纹理细节爆炸4. 示例一键加载内置经典示例小猫咪、汉服美女、超详细女性点击即可自动填充提示词、分辨率、步数、前缀亮点公共分享链接运行脚本时自动生成Gradio 公共链接限时 1 周只要你的 Windows 电脑上一直运行着该项目Gradio 公共链接将在任意可上网的浏览器中限时有效。分享方式发给好友他们无需安装任何环境直接在浏览器使用自己在手机上打开链接随时随地生成图片完美解决“想让朋友玩但他们不会装环境”的痛点生成效果展示小猫咪雪天窗台经典提示词汉服美女 大雁塔夜景官方长提示词超详细美女经典测试批量生成示例猫、狗、猪、美女4x 放大后效果受限于模型还有待提升总结这套 Z-Image-Turbo 专业生成器是我 2025 年底较为满意的技术魔改之一。它把最高性能本地 Flash Attention 加速最完整功能批量 放大 历史 自动保存最友好体验Gradio 界面 公共分享完美结合在了一起。后续仍会有更新迭代敬请期待。zimage_gui.py# zimage_gui.py # Z-Image-Turbo 专业版 Gradio 生成器Windows RTX 3090 终极稳定版 # 已集成本地 Flash Attention 2.8.3 加速 批量生成 4x 图片放大 生成历史画廊 智能自动序号文件名 # 修复尺寸自动校正为16倍数 Gradio 输出绑定 兼容最新 torchvision 公共链接手机生成稳定 import os import torch import gradio as gr from diffusers import ZImagePipeline from PIL import Image import datetime import glob import re import numpy as np # 关键修复 os.environ[DIFFUSERS_NO_UP_CAST_ATTENTION] 1 # 禁用 float32 upcast import warnings warnings.filterwarnings(ignore, messagetorch_dtype is deprecated! Use dtype instead!) # 模型加载 print(正在加载 Z-Image-Turbo 模型bfloat16首次稍慢请耐心等待...) pipe ZImagePipeline.from_pretrained( Tongyi-MAI/Z-Image-Turbo, torch_dtypetorch.bfloat16, ) pipe.to(cuda) # 启用本地 Flash Attention 2.8.3 try: if hasattr(pipe.transformer, set_attention_backend): pipe.transformer.set_attention_backend(flash) print(✅ 已成功启用本地 Flash Attention 2.8.3 加速) else: print(ℹ️ diffusers 不支持直接设置但 FlashAttention 已自动启用) except Exception as e: print(f⚠️ Flash Attention 设置异常无影响{e}) print( 模型加载完成可以开始生成啦) # UpscaleReal-ESRGAN 4x from basicsr.archs.rrdbnet_arch import RRDBNet from realesrgan import RealESRGANer # 关键修复使用 tile400 分块处理避免手机/公共链接显存 OOM upsampler RealESRGANer( scale4, model_pathhttps://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth, modelRRDBNet(num_in_ch3, num_out_ch3, num_feat64, num_block23, num_grow_ch32, scale4), tile400, # 分块处理显存友好解决公共链接卡死/unknown error tile_pad10, pre_pad0, halfTrue, gpu_id0 ) def upscale_image(input_image): if input_image is None: return None torch.cuda.empty_cache() # 清理显存碎片 img_array np.array(input_image) output, _ upsampler.enhance(img_array, outscale4) return Image.fromarray(output) # 智能文件名生成 HISTORY_DIR generation_history os.makedirs(HISTORY_DIR, exist_okTrue) def get_next_filename(prefix): if not prefix.strip(): prefix zimage prefix re.sub(r[^\w\-_], _, prefix) pattern os.path.join(HISTORY_DIR, f{prefix}_*.png) existing glob.glob(pattern) numbers [] for f in existing: match re.search(rf{re.escape(prefix)}_(\d{{3}})\.png$, os.path.basename(f)) if match: numbers.append(int(match.group(1))) next_num max(numbers) 1 if numbers else 1 return os.path.join(HISTORY_DIR, f{prefix}_{next_num:03d}.png) def get_history_gallery(): files sorted(glob.glob(os.path.join(HISTORY_DIR, *.png)), keyos.path.getmtime, reverseTrue) return [(Image.open(f), os.path.basename(f)) for f in files[:50]] # 生成函数 def generate_single(prompt, height, width, steps, seed, prefix): height max(512, int((height // 16) * 16)) width max(512, int((width // 16) * 16)) generator None if seed -1 else torch.Generator(cuda).manual_seed(int(seed)) torch.cuda.empty_cache() # 生成前清理显存 with torch.inference_mode(): image pipe( promptprompt, heightheight, widthwidth, num_inference_stepsint(steps), guidance_scale0.0, generatorgenerator, ).images[0] save_path get_next_filename(prefix) image.save(save_path) return image, f✅ 生成完成尺寸: {width}x{height}\n已保存: {os.path.basename(save_path)} def generate_batch(prompts_text, height, width, steps, seed, prefix): prompts [p.strip() for p in prompts_text.split(\n) if p.strip()] if not prompts: return None, 请输入至少一个提示词 height max(512, int((height // 16) * 16)) width max(512, int((width // 16) * 16)) outputs [] status_lines [] for i, prompt in enumerate(prompts): torch.cuda.empty_cache() # 每张图前清理显存 gen_seed -1 if seed -1 else int(seed) i generator None if gen_seed -1 else torch.Generator(cuda).manual_seed(gen_seed) with torch.inference_mode(): image pipe(promptprompt, heightheight, widthwidth, num_inference_stepsint(steps), guidance_scale0.0, generatorgenerator).images[0] save_path get_next_filename(prefix) image.save(save_path) outputs.append(image) status_lines.append(f[{i 1}/{len(prompts)}] {prompt[:40]}... → {os.path.basename(save_path)}) return outputs, \n.join(status_lines) f\n批量完成尺寸: {width}x{height} # Gradio 界面 with gr.Blocks(titleZ-Image-Turbo 专业版) as demo: gr.Markdown(# Z-Image-Turbo 专业生成器) gr.Markdown(**Windows RTX 3090 终极版** | Flash Attention 加速 | 批量 放大 历史 自动序号保存) with gr.Tabs(): # 单图生成 with gr.Tab(单图生成): with gr.Row(): with gr.Column(scale3): prompt gr.Textbox( label提示词Prompt, lines6, placeholder输入详细描述支持中英文..., value一只超级可爱的小猫咪坐在古风窗台上窗外下雪毛发蓬松细腻阳光洒落写实摄影风格8k高清 ) prefix1 gr.Textbox( label文件名前缀可选, value, placeholder例cat_自动加序号如 cat_001.png ) with gr.Row(): height gr.Slider(512, 2048, value1024, step16, label高度自动校正为16倍数) width gr.Slider(512, 2048, value1024, step16, label宽度自动校正为16倍数) with gr.Row(): steps gr.Slider(4, 20, value8, step1, label推理步数推荐8) seed gr.Number(value-1, label种子-1随机) single_btn gr.Button( 生成单图, variantprimary) with gr.Column(scale2): single_image gr.Image(label生成结果, height700) single_status gr.Textbox(label状态) # 经典示例 gr.Examples( examples[ [一只超级可爱的小猫咪坐在古风窗台上窗外下雪毛发蓬松细腻阳光洒落写实摄影风格8k高清, 1024, 1024, 8, -1, cat_], [Young Chinese woman in red Hanfu, intricate embroidery. Impeccable makeup, red floral forehead pattern. Elaborate high bun, golden phoenix headdress, red flowers, beads. Holds round folding fan with lady, trees, bird. Neon lightning-bolt lamp (⚡️), bright yellow glow, above extended left palm. Soft-lit outdoor night background, silhouetted tiered pagoda (西安大雁塔), blurred colorful distant lights., 1024, 1024, 8, 42, hanfu_], [A beautiful woman, hyper-detailed, 8K, cinematic lighting, 1024, 1024, 8, 123, beauty_], ], inputs[prompt, height, width, steps, seed, prefix1] ) single_btn.click(generate_single, inputs[prompt, height, width, steps, seed, prefix1], outputs[single_image, single_status]) # 批量生成 with gr.Tab(批量生成): batch_prompts gr.Textbox(label批量提示词每行一个, lines10) prefix_batch gr.Textbox(label批量文件名前缀可选, value, placeholder例beauty_) with gr.Row(): batch_height gr.Slider(512, 2048, value1024, step16, label高度) batch_width gr.Slider(512, 2048, value1024, step16, label宽度) batch_steps gr.Slider(4, 20, value8, step1, label步数) batch_seed gr.Number(value-1, label基础种子) batch_btn gr.Button( 开始批量生成, variantprimary) batch_gallery gr.Gallery(label批量结果, columns3) batch_status gr.Textbox(label进度) batch_btn.click(generate_batch, inputs[batch_prompts, batch_height, batch_width, batch_steps, batch_seed, prefix_batch], outputs[batch_gallery, batch_status]) # 图片放大 with gr.Tab(图片放大): gr.Markdown(从历史画廊点击图片或手动上传 → 4x 超分已优化显存公共链接稳定) upscale_input gr.Image(label待放大图片, typepil) upscale_btn gr.Button( 4x 放大Real-ESRGAN, variantprimary) upscale_output gr.Image(label放大结果) upscale_btn.click(upscale_image, inputsupscale_input, outputsupscale_output) # 生成历史 with gr.Tab(生成历史): gr.Markdown(最近 50 张记录点击图片可上传到“图片放大”页) history_gallery gr.Gallery(valueget_history_gallery(), label历史记录, columns4) refresh_btn gr.Button( 刷新历史) refresh_btn.click(lambda: gr.update(valueget_history_gallery()), outputshistory_gallery) # 启动 demo.queue(max_size30) demo.launch( server_name0.0.0.0, server_port7860, shareTrue, inbrowserTrue )如果你也在 Windows 上玩 AI 图像生成强烈推荐按我的方案搭建一套——从编译到界面一步到位爽到飞起玩得开心✨—— 一个在 Windows 上坚持玩转 AI 的普通爱好者
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

学院网站策划书手机qq怎么用wordpress

目录Vue-SpringBoot 毕业设计选题管理系统的摘要开发技术核心代码参考示例1.建立用户稀疏矩阵,用于用户相似度计算【相似度矩阵】2.计算目标用户与其他用户的相似度总结源码文档获取/同行可拿货,招校园代理 :文章底部获取博主联系方式!Vue-Sp…

张小明 2026/1/10 22:10:35 网站建设

广州市建设注册中心网站首页wordpress团购插件

1.简介前边几篇文章是宏哥自己在本地弄了一个单选和多选的demo,给小伙伴或童鞋们演示了一下如何使用playwright来处理单选按钮和多选按钮进行自动化测试,想必大家都已经掌握的八九不离十了吧。这一篇其实也很简单,主要是分两部分内容来讲解和…

张小明 2026/1/10 22:01:20 网站建设

网站手册网站建设公司中企动力

现代化前端UI一致性保障完整指南:像素级差异检测的终极方案 【免费下载链接】pixelmatch The smallest, simplest and fastest JavaScript pixel-level image comparison library 项目地址: https://gitcode.com/gh_mirrors/pi/pixelmatch 在当今快速迭代的前…

张小明 2026/1/10 17:51:55 网站建设

网站建设需求说明黄页网站介绍

第一章:Open-AutoGLM本地搭建的核心挑战在本地环境中部署 Open-AutoGLM 模型面临多重技术障碍,涉及硬件资源、依赖管理与系统兼容性等多个层面。由于该模型基于大规模生成语言架构,对计算资源的需求尤为严苛,普通开发设备往往难以…

张小明 2026/1/13 0:17:01 网站建设

网站系统开发方式wordpress主题lovephoto2.0.1

STM32CubeMX 打不开?别急着重装,先试试这招“急救”方案你有没有遇到过这种情况:早上兴致勃勃准备开始调试新项目,结果双击桌面上熟悉的STM32CubeMX 图标——没反应。再点一次,任务管理器里javaw.exe闪了一下又消失。查…

张小明 2026/1/10 16:28:04 网站建设

域名论坛网站陕西铜川煤矿建设有限公司网站

第一章:国产大模型自动化新突破概述近年来,随着人工智能技术的迅猛发展,国产大模型在自动化能力方面实现了显著突破。依托大规模预训练架构与本土化数据优势,国内科技企业如华为、百度、阿里和智谱AI等相继推出具备自主推理、任务…

张小明 2026/1/10 21:49:37 网站建设