Skip to content

Commit

Permalink
🐛 fix: Fix some style problem and image info bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Nov 29, 2023
1 parent ab55147 commit 3e0e942
Show file tree
Hide file tree
Showing 14 changed files with 107 additions and 60 deletions.
110 changes: 57 additions & 53 deletions javascript/main.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions locales/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "Benutzerdefiniert"
},
"cancel": "Abbrechen",
"confirm": "Bestätigen",
"custom": {
"initializing": "StableDiffusion / LobeTheme initialisiert, bitte warten..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "Custom"
},
"cancel": "Cancel",
"confirm": "Confirm",
"custom": {
"initializing": "StableDiffusion / LobeTheme is initializing, please wait..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "Personalizado"
},
"cancel": "Cancelar",
"confirm": "Confirmar",
"custom": {
"initializing": "StableDiffusion / LobeTheme se está inicializando, por favor espere..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "Personnalisé"
},
"cancel": "Annuler",
"confirm": "Confirmer",
"custom": {
"initializing": "StableDiffusion / LobeTheme est en cours d'initialisation, veuillez patienter..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "カスタム"
},
"cancel": "キャンセル",
"confirm": "確認",
"custom": {
"initializing": "StableDiffusion / LobeTheme が初期化中です。お待ちください..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "사용자 정의"
},
"cancel": "취소",
"confirm": "확인",
"custom": {
"initializing": "StableDiffusion / LobeTheme이 초기화 중입니다. 잠시 기다려주세요..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "Personalizado"
},
"cancel": "Cancelar",
"confirm": "Confirmar",
"custom": {
"initializing": "StableDiffusion / LobeTheme está inicializando, por favor aguarde..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "Пользовательский"
},
"cancel": "Отмена",
"confirm": "Подтвердить",
"custom": {
"initializing": "StableDiffusion / LobeTheme инициализируется, пожалуйста, подождите..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "自定义"
},
"cancel": "取消",
"confirm": "确认",
"custom": {
"initializing": "StableDiffusion / LobeTheme 正在初始化,请稍候..."
},
Expand Down
2 changes: 2 additions & 0 deletions locales/zh_HK.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"lobe": "LobeHub",
"custom": "自定義"
},
"cancel": "取消",
"confirm": "確認",
"custom": {
"initializing": "StableDiffusion / LobeTheme 正在初始化,請稍候..."
},
Expand Down
16 changes: 12 additions & 4 deletions src/features/Setting/Form/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from 'antd';
import { Button, Popconfirm } from 'antd';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';

Expand All @@ -16,9 +16,17 @@ const Footer = memo(() => {

return (
<>
<Button danger onClick={onReset} style={{ borderRadius: 4 }} type="text">
{t('setting.button.reset')}
</Button>
<Popconfirm
cancelText={t('cancel')}
okText={t('confirm')}
okType={'danger'}
onConfirm={onReset}
title={t('setting.button.reset')}
>
<Button danger style={{ borderRadius: 4 }}>
{t('setting.button.reset')}
</Button>
</Popconfirm>
<Button htmlType="submit" style={{ borderRadius: 4 }} type="primary">
{t('setting.button.submit')}
</Button>
Expand Down
15 changes: 13 additions & 2 deletions src/modules/ImageInfo/features/formatInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,20 @@ export const formatInfo = (info: string) => {
configs[items[0].trim()] = items[1].trim();
}

let position = data[0];
let negative = data[2] ? data[1] : '';

if (position.includes('Negative prompt:')) {
negative = position;
position = '';
}

position = formatPrompt(position);
negative = formatPrompt(negative.split('Negative prompt: ')[1]);

return {
config: configs,
negative: formatPrompt(data[2] ? decodeURI(data[1]).split('Negative prompt: ')[1] : ''),
positive: formatPrompt(decodeURI(data[0])),
negative: negative,
positive: position,
};
};
6 changes: 5 additions & 1 deletion src/styles/components/gallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,17 @@ export default (token: Theme) => {
[id$='_gallery_container'] {
min-height: 470px;
> div {
> div:not([id$='_generate_box']) {
flex-grow: 1;
[id$='_gallery'] {
flex-grow: 1;
}
}
}
div[id^='img2img_'].block.gradio-image {
height: auto !important;
}
`;
};

0 comments on commit 3e0e942

Please sign in to comment.