Skip to content

Commit

Permalink
fix: chinese prompt for sd3, add sd3 price
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu-xiaowei committed Jan 3, 2025
1 parent 7feedb2 commit 3497bb0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion react-native/src/chat/component/ImageProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const ImageProgressBar = () => {
useNativeDriver: true,
}).start();
} else if (event?.event === 'onImageStop') {
console.log('onImageStop');
startProgressAnimation(100, 200).start();
} else if (event?.event === 'onImageStart') {
Animated.sequence([
Expand Down
6 changes: 6 additions & 0 deletions react-native/src/settings/ModelPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ export const ModelPrice: ModelPriceType = {
'SD3 Large 1.0': {
medium: 0.08,
},
'Stable Diffusion 3.5 Large': {
medium: 0.08,
},
'Stable Image Core 1.0': {
medium: 0.04,
},
Expand Down Expand Up @@ -277,6 +280,9 @@ type ImageModelPrices = {
'SD3 Large 1.0': {
medium: number;
};
'Stable Diffusion 3.5 Large': {
medium: number;
};
'Stable Image Core 1.0': {
medium: number;
};
Expand Down
2 changes: 1 addition & 1 deletion server/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async def gen_image(request: ImageRequest,
region = request.region
client = boto3.client("bedrock-runtime",
region_name=region)
if ref_images is None and contains_chinese(prompt):
if (ref_images is None or model_id.startswith("stability.")) and contains_chinese(prompt):
prompt = get_english_prompt(client, prompt)
return get_image(client, model_id, prompt, ref_images, width, height)

Expand Down

0 comments on commit 3497bb0

Please sign in to comment.