进度条提前
This commit is contained in:
@@ -80,13 +80,13 @@ div(class="mt-[60px] grid grid-cols-1 lg:grid-cols-4 xl:grid-cols-5 text-white b
|
|||||||
)
|
)
|
||||||
img(:src="IconStack")
|
img(:src="IconStack")
|
||||||
// 卡片模式
|
// 卡片模式
|
||||||
div.flex(:class="{'justify-center': !views.cardMode, 'flex-col':views.cardMode}")
|
div.flex.flex-wrap.gap-6(:class="{'justify-center': !views.cardMode, 'flex-col':views.cardMode}")
|
||||||
template(v-for="task in tasks" :key="task.id")
|
template(v-for="task in tasks" :key="task.id")
|
||||||
div.relative.bg-green-600.rounded-md(v-if="task.data" style="max-width: min(512px, 100%);")
|
div.relative.bg-green-600.rounded-md.overflow-hidden.w-512px.h-512px.min-w-512px.transition-all.duration-150.ease-linear
|
||||||
div.object-contain
|
div.object-contain(v-if="task.data")
|
||||||
img(loading="lazy" :src="img" alt="task" v-for="img in task.data" :key="img")
|
img(loading="lazy" :src="img" alt="task" v-for="img in task.data" :key="img")
|
||||||
div.absolute.left-2.right-2.bottom-2.h-8.bg-green-500.rounded-full.overflow-hidden.text-green-900.text-xs
|
div.absolute.left-2.right-2.bottom-2.h-8.bg-green-500.rounded-full.overflow-hidden.text-green-900.text-xs
|
||||||
div.h-full.flex.items-center.text-center.px-2.bg-green-400(:style="`width:${task.progress*100}%`") {{ task.status }} {{ task.progress*100 }}%
|
div.h-full.flex.items-center.text-center.px-2.bg-green-400.transition-all.duration-5000.ease-linear(:style="`width:${task.progress*100}%`") {{ task.status }} {{ task.progress*100 }}%
|
||||||
div.absolute.inset-0.flex.flex-col.items-center.justify-center.transition-opacity.bg-gradient-to-t.to-transparent.opacity-0(class="hover:cursor-pointer hover:opacity-100 from-black/90")
|
div.absolute.inset-0.flex.flex-col.items-center.justify-center.transition-opacity.bg-gradient-to-t.to-transparent.opacity-0(class="hover:cursor-pointer hover:opacity-100 from-black/90")
|
||||||
pre {{ task }}
|
pre {{ task }}
|
||||||
// 右侧参数
|
// 右侧参数
|
||||||
|
@@ -261,7 +261,7 @@ def main_dev(opt):
|
|||||||
print(f"加载到显存完成: {model_name}")
|
print(f"加载到显存完成: {model_name}")
|
||||||
|
|
||||||
# 更新任务状态为运行中
|
# 更新任务状态为运行中
|
||||||
update_task_status(task, "running", 0)
|
update_task_status(task, "running", 0.5)
|
||||||
|
|
||||||
# 使用指定的模型和配置文件进行推理一组参数
|
# 使用指定的模型和配置文件进行推理一组参数
|
||||||
if opt.plms:
|
if opt.plms:
|
||||||
@@ -307,7 +307,7 @@ def main_dev(opt):
|
|||||||
start_code = torch.randn([task['number'], opt.C, opt.H // opt.f, opt.W // opt.f], device=device)
|
start_code = torch.randn([task['number'], opt.C, opt.H // opt.f, opt.W // opt.f], device=device)
|
||||||
|
|
||||||
# 更新进度
|
# 更新进度
|
||||||
update_task_status(task, "running", 0.1)
|
update_task_status(task, "running", 0.8)
|
||||||
|
|
||||||
# 生成图片
|
# 生成图片
|
||||||
precision_scope = autocast if opt.precision == "autocast" or opt.bf16 else nullcontext
|
precision_scope = autocast if opt.precision == "autocast" or opt.bf16 else nullcontext
|
||||||
@@ -323,7 +323,7 @@ def main_dev(opt):
|
|||||||
prompts = list(prompts)
|
prompts = list(prompts)
|
||||||
c = model.get_learned_conditioning(prompts)
|
c = model.get_learned_conditioning(prompts)
|
||||||
shape = [opt.C, opt.H // opt.f, opt.W // opt.f]
|
shape = [opt.C, opt.H // opt.f, opt.W // opt.f]
|
||||||
update_task_status(task=task, status='diffusing', progress=0.5) # 修改任务状态
|
update_task_status(task=task, status='diffusing', progress=0.9) # 修改任务状态
|
||||||
samples, _ = sampler.sample(S=opt.steps,
|
samples, _ = sampler.sample(S=opt.steps,
|
||||||
conditioning=c,
|
conditioning=c,
|
||||||
batch_size=task['number'],
|
batch_size=task['number'],
|
||||||
|
Reference in New Issue
Block a user