Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cog-anytext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanjinfei
cog-anytext
Commits
56f11e80
Commit
56f11e80
authored
Jul 22, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update predit
parent
1f37ab75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
11 deletions
+40
-11
.DS_Store
.DS_Store
+0
-0
predict.py
predict.py
+40
-11
No files found.
.DS_Store
View file @
56f11e80
No preview for this file type
predict.py
View file @
56f11e80
...
...
@@ -4,14 +4,9 @@
from
cog
import
BasePredictor
,
Input
,
Path
from
typing
import
List
from
modelscope.pipelines
import
pipeline
from
util
import
save_images
,
read_img_result
from
util
import
read_img_result
img_save_folder
=
"SaveImages"
params
=
{
"show_debug"
:
True
,
"image_count"
:
2
,
"ddim_steps"
:
20
,
}
class
Predictor
(
BasePredictor
):
...
...
@@ -25,15 +20,49 @@ class Predictor(BasePredictor):
"text-generation"
,
"text-editing"
]),
prompt
:
str
=
Input
(
description
=
"Input prompt"
,
default
=
'photo of caramel macchiato coffee on the table, top-down perspective, with "Any" "Text" written on it using cream'
),
seed
:
int
=
Input
(
description
=
""
,
default
=
66273235
,
seed
:
int
=
Input
(
description
=
"
Seed
"
,
default
=
66273235
,
ge
=
0
,
le
=
66273235
),
draw_pos
:
Path
=
Input
(
description
=
""
,
default
=
'https://replicate.delivery/pbxt/LIHKXdjxOWFe7HqP1rliIsghRab48EVQRzGNwQ9RgyO5V03d/gen9.png'
),
description
=
"
Draw Pos
"
,
default
=
'https://replicate.delivery/pbxt/LIHKXdjxOWFe7HqP1rliIsghRab48EVQRzGNwQ9RgyO5V03d/gen9.png'
),
ori_image
:
Path
=
Input
(
description
=
""
,
default
=
'https://replicate.delivery/pbxt/LIHMZ8cCvmndHNVufiSuKZA4mnokuSOy87cYqhvs4Diei7sL/edit9.png'
),
use_fp32
:
bool
=
Input
(
description
=
""
,
default
=
False
),
no_translator
:
bool
=
Input
(
description
=
""
,
default
=
False
),
description
=
"Ori Image"
,
default
=
'https://replicate.delivery/pbxt/LIHMZ8cCvmndHNVufiSuKZA4mnokuSOy87cYqhvs4Diei7sL/edit9.png'
),
img_count
:
int
=
Input
(
description
=
"Image Count"
,
default
=
2
,
ge
=
0
,
le
=
5
),
ddim_steps
:
int
=
Input
(
description
=
"DDIM Steps"
,
default
=
20
,
ge
=
20
,
le
=
100
),
use_fp32
:
bool
=
Input
(
description
=
"Use Fp32"
,
default
=
False
),
no_translator
:
bool
=
Input
(
description
=
"No Translator"
,
default
=
False
),
strength
:
float
=
Input
(
description
=
""
,
default
=
1.0
,
ge
=
0.0
,
le
=
2.0
),
img_width
:
int
=
Input
(
description
=
"Image Width"
,
default
=
512
,
ge
=
256
,
le
=
768
),
img_height
:
int
=
Input
(
description
=
"Image Height"
,
default
=
512
,
ge
=
512
,
le
=
1024
),
cfg_scale
:
float
=
Input
(
description
=
"CFG-Scale"
,
default
=
9.0
,
ge
=
0.1
,
le
=
30.0
),
a_prompt
:
str
=
Input
(
description
=
"Added Prompt"
,
default
=
"best quality, extremely detailed,4k, HD, supper legible text, clear text edges, clear strokes, neat writing, no watermarks"
),
n_prompt
:
str
=
Input
(
description
=
"Negative Prompt"
,
default
=
"low-res, bad anatomy, extra digit, fewer digits, cropped, worst quality, low quality, watermark, unreadable text, messy words, distorted text, disorganized writing, advertising picture"
),
sort_radio
:
str
=
Input
(
description
=
"Sort Position,position sorting priority"
,
choices
=
[
"↕"
,
"↔"
],
default
=
"↕"
),
revise_pos
:
bool
=
Input
(
description
=
"Revise Position"
,
default
=
False
),
)
->
List
[
Path
]:
params
=
{
"show_debug"
:
True
,
"image_count"
:
img_count
,
"ddim_steps"
:
ddim_steps
,
"strength"
:
strength
,
"image_width"
:
img_width
,
"image_height"
:
img_height
,
"a_prompt"
:
a_prompt
,
"n_prompt"
:
n_prompt
,
"cfg_scale"
:
cfg_scale
,
"revise_pos"
:
revise_pos
,
"sort_priority"
:
sort_radio
,
}
input_data
=
{}
if
mode
==
"text-generation"
:
input_data
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment